]> gitweb.fperrin.net Git - Dictionary.git/blobdiff - src/com/hughes/android/dictionary/engine/Index.java
Fixed crashes, Slovenian fix, hide up/down buttons, proper keyboard
[Dictionary.git] / src / com / hughes / android / dictionary / engine / Index.java
index 68a0dc27a9d6ee3645cde0a322839bafa98bbfef..cea2caca639db601979d86d7082e890bfeaeeb46 100644 (file)
@@ -21,7 +21,6 @@ import com.hughes.android.dictionary.DictionaryInfo;
 import com.hughes.android.dictionary.DictionaryInfo.IndexInfo;
 import com.hughes.android.dictionary.engine.RowBase.RowKey;
 import com.hughes.util.CachingList;
-import com.hughes.util.CollectionUtil;
 import com.hughes.util.TransformingList;
 import com.hughes.util.raf.RAFList;
 import com.hughes.util.raf.RAFSerializable;
@@ -305,7 +304,7 @@ public final class Index implements RAFSerializable<Index> {
       if (!indexEntry.normalizedToken.startsWith(normalizedPrefix)) {
         break;
       }
-      rowCount += indexEntry.numRows;
+      rowCount += indexEntry.numRows + indexEntry.htmlEntries.size();
       if (rowCount > maxRows) {
         System.out.println("Giving up, too many words with prefix: " + normalizedPrefix);
         break;
@@ -373,11 +372,10 @@ public final class Index implements RAFSerializable<Index> {
     final int exactMatchIndex = findInsertionPointIndex(searchText, interrupted);
     if (exactMatchIndex != -1) {
         final IndexEntry exactMatch = sortedIndexEntries.get(exactMatchIndex);
-        if (pattern.matcher(exactMatch.token).matches()) {
+        if (pattern.matcher(exactMatch.token).find()) {
             matches.get(RowMatchType.TITLE_MATCH).add(rows.get(exactMatch.startRow));
         }
     }
-
     
     final String searchToken = bestPrefix;
     final int insertionPointIndex = findInsertionPointIndex(searchToken, interrupted);