]> gitweb.fperrin.net Git - Dictionary.git/blobdiff - src/com/hughes/android/dictionary/engine/Index.java
Cache Transliterators.
[Dictionary.git] / src / com / hughes / android / dictionary / engine / Index.java
index 5ee2ce96a4984ad8a9e823b28410f973e4daacc2..665f42d0437e818e9c69bf2eb1151c4657c1f626 100644 (file)
@@ -13,7 +13,7 @@
 // limitations under the License.
 
 /**
- * 
+ *
  */
 
 package com.hughes.android.dictionary.engine;
@@ -106,8 +106,7 @@ public final class Index implements RAFSerializable<Index> {
      */
     public synchronized Transliterator normalizer() {
         if (normalizer == null) {
-            normalizer = Transliterator
-                    .createFromRules("", normalizerRules, Transliterator.FORWARD);
+            normalizer = TransliteratorManager.get(normalizerRules);
         }
         return normalizer;
     }
@@ -310,7 +309,7 @@ public final class Index implements RAFSerializable<Index> {
             }
             final IndexEntry midEntry = sortedIndexEntries.get(mid);
 
-            int comp = NormalizeComparator.compareWithoutLeadingDash(token, midEntry.normalizedToken(), sortCollator, dict.dictFileVersion);
+            int comp = NormalizeComparator.compareWithoutDash(token, midEntry.normalizedToken(), sortCollator, dict.dictFileVersion);
             if (comp == 0)
                 comp = sortCollator.compare(token, midEntry.normalizedToken());
             if (comp == 0) {