@@ -0,0 +1,1998 @@
+/*%0A *  BSD License (http://lemurproject.org/galago-license)%0A */%0Apackage org.lemurproject.galago.core.tools.apps;%0A%0Aimport java.io.PrintStream;%0Aimport org.lemurproject.galago.core.index.IndexPartReader;%0Aimport org.lemurproject.galago.core.index.KeyIterator;%0Aimport org.lemurproject.galago.core.index.disk.DiskIndex;%0Aimport org.lemurproject.galago.core.retrieval.iterator.MovableCountIterator;%0Aimport org.lemurproject.galago.core.retrieval.processing.ScoringContext;%0Aimport org.lemurproject.galago.core.tools.AppFunction;%0Aimport org.lemurproject.galago.tupleflow.Parameters;%0A%0A/**%0A *%0A * @author sjh%0A */%0Apublic class DumpTermStatisticsFn extends AppFunction %7B%0A%0A  @Override%0A  public String getName() %7B%0A    return %22dump-term-stats%22;%0A  %7D%0A%0A  @Override%0A  public String getHelpString() %7B%0A    return %22galago dump-term-stats %3Cindex-part%3E %5Cn%5Cn%22%0A            + %22  Dumps %3Cterm%3E %3Cfrequency%3E %3Cdocument count%3E statsistics from the%22%0A            + %22 the specified index part.%5Cn%22;%0A  %7D%0A%0A  @Override%0A  public void run(String%5B%5D args, PrintStream output)%0A          throws Exception %7B%0A    ScoringContext sc = new ScoringContext();%0A    IndexPartReader reader = DiskIndex.openIndexPart(args%5B1%5D);%0A    KeyIterator iterator = reader.getIterator();%0A    while (!iterator.isDone()) %7B%0A      MovableCountIterator mci = (MovableCountIterator) iterator.getValueIterator();%0A      mci.setContext(sc);%0A      long frequency = 0;%0A      long documentCount = 0;%0A      while (!mci.isDone()) %7B%0A        sc.document = mci.currentCandidate();%0A        if (mci.hasMatch(mci.currentCandidate())) %7B%0A          frequency += mci.count();%0A          documentCount++;%0A        %7D%0A        mci.movePast(mci.currentCandidate());%0A      %7D%0A      output.printf(%22%25s%5Ct%25d%5Ct%25d%5Cn%22, iterator.getKeyString(), frequency, documentCount);%0A      iterator.nextKey();%0A    %7D%0A    reader.close();%0A  %7D%0A%0A  @Override%0A  public void run(Parameters p, PrintStream output) throws Exception %7B%0A    String indexPath = p.getString(%22indexPath%22);%0A    run(new String%5B%5D%7B%22%22, indexPath%7D, output);%0A  %7D%0A%7D

Put the foolish thing back.