]> gitweb.fperrin.net Git - DictionaryPC.git/blobdiff - src/com/hughes/android/dictionary/engine/IndexBuilder.java
zipSize, overrideStoplist-> special isMainEntry, tagalog, trying to
[DictionaryPC.git] / src / com / hughes / android / dictionary / engine / IndexBuilder.java
index 6f28d30ba0faee0131d2fcd533706c70e48805c9..62cdcd7336d508f83105deda9e588f0250d2730e 100644 (file)
@@ -46,12 +46,17 @@ public class IndexBuilder {
   public void build() {
     final Set<IndexedEntry> tokenEntryDatas = new HashSet<IndexedEntry>();
     final List<RowBase> rows = index.rows;
+    index.mainTokenCount = 0;
     for (final TokenData tokenData : tokenToData.values()) {
       tokenEntryDatas.clear();
       final int indexIndex = index.sortedIndexEntries.size();
       final int startRow = rows.size();
       
-      rows.add(new TokenRow(indexIndex, rows.size(), index, tokenData.hasMainEntry));
+      final TokenRow tokenRow = new TokenRow(indexIndex, rows.size(), index, tokenData.hasMainEntry);
+      rows.add(tokenRow);
+      if (tokenRow.hasMainEntry) {
+        index.mainTokenCount++;
+      }
 //      System.out.println("Added TokenRow: " + rows.get(rows.size() - 1));
       int numRows = 0;
 //      System.out.println("TOKEN: " + tokenData.token);
@@ -63,6 +68,7 @@ public class IndexBuilder {
           }
           if (tokenEntryDatas.add(entryData)) {
             rows.add(new PairEntry.Row(entryData.index(), rows.size(), index));
+            ++entryData.entry.entrySource.numEntries;
             ++numRows;
             
 //            System.out.print("  " + typeToEntry.getKey() + ": ");
@@ -112,7 +118,7 @@ public class IndexBuilder {
   private List<IndexedEntry> getOrCreateEntries(final String token, final EntryTypeName entryTypeName) {
     final TokenData tokenData = getOrCreateTokenData(token);
     List<IndexedEntry> entries = tokenData.typeToEntries.get(entryTypeName);
-    if (entryTypeName.overridesStopList) {
+    if (entryTypeName.mainWord) {
       tokenData.hasMainEntry = true;
     }
     if (entries == null) {