コード例 #1
0
  public void createIndex() throws IOException {

    closeWriters(ngramWriters.values());

    Comparator<String> comparator =
        new Comparator<String>() {
          @Override
          public int compare(String r1, String r2) {
            return r1.compareTo(r2);
          }
        };

    // read the file with the counts per file and create the final
    // aggregated counts
    for (int level = minNgramLength; level <= maxNgramLength; level++) {
      Integer nextFreeFileNumber = processInputFileForLevel(level, comparator);

      processCreatedMiscFileAgain(level, comparator, nextFreeFileNumber);
    }

    if (writeIndexes) {
      JWeb1TIndexer indexer = new JWeb1TIndexer(outputPath, maxNgramLength);
      indexer.create();
    }
  }
コード例 #2
0
 public static void main(String[] args) throws Exception {
   JWeb1TIndexer indexer = new JWeb1TIndexer("src/test/resources/web1t/", 2);
   indexer.create();
 }