]> gitweb.fperrin.net Git - DictionaryPC.git/blobdiff - src/com/hughes/android/dictionary/engine/IndexBuilder.java
Moved normalization, more tests.
[DictionaryPC.git] / src / com / hughes / android / dictionary / engine / IndexBuilder.java
index 95a6b07243e17e9afae7297a20877f2ea4813c6b..0d111911edcb0a3a87a9b27957c809ad8b355a58 100644 (file)
@@ -39,7 +39,7 @@ public class IndexBuilder {
   IndexBuilder(final DictionaryBuilder dictionaryBuilder, final String shortName, final String longName, final Language language, final String normalizerRules, final Set<String> stoplist, final boolean swapPairEntries) {
     this.dictionaryBuilder = dictionaryBuilder;
     index = new Index(dictionaryBuilder.dictionary, shortName, longName, language, normalizerRules, swapPairEntries, stoplist);
-    tokenToData = new TreeMap<String, TokenData>(new NormalizeComparator(index.normalizer(), language.getCollator()));
+    tokenToData = new TreeMap<String, TokenData>(index.getSortComparator());
     this.stoplist = stoplist;
   }
   
@@ -58,7 +58,7 @@ public class IndexBuilder {
         index.mainTokenCount++;
       }
 //      System.out.println("Added TokenRow: " + rows.get(rows.size() - 1));
-      int numRows = 0;
+      int numRows = 0;  // off by one--doesn't count the token row!
 //      System.out.println("TOKEN: " + tokenData.token);
       for (final Map.Entry<EntryTypeName, List<IndexedEntry>> typeToEntry : tokenData.typeToEntries.entrySet()) {
         for (final IndexedEntry entryData : typeToEntry.getValue()) {