diff options
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/BinaryDictionary.java | 19 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/Suggest.java | 8 |
2 files changed, 5 insertions, 22 deletions
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java index 61ecec922..deb94a450 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java @@ -61,11 +61,6 @@ public class BinaryDictionary extends Dictionary { public static final Flag FLAG_REQUIRES_FRENCH_LIGATURES_PROCESSING = new Flag(R.bool.config_require_ligatures_processing, 0x4); - // FULL_EDIT_DISTANCE is a flag that forces the dictionary to use full words - // when computing edit distance, instead of the default behavior of stopping - // the evaluation at the size the user typed. - public static final int FLAG_USE_FULL_EDIT_DISTANCE = 0x2; - // Can create a new flag from extravalue : // public static final Flag FLAG_MYFLAG = // new Flag("my_flag", 0x02); @@ -85,7 +80,7 @@ public class BinaryDictionary extends Dictionary { FLAG_REQUIRES_FRENCH_LIGATURES_PROCESSING, }; - private final int mFlags; + private final boolean mUseFullEditDistance; /** * Constructor for the binary dictionary. This is supposed to be called from the @@ -104,11 +99,7 @@ public class BinaryDictionary extends Dictionary { // Initializing this here will help transitioning out of the scheme where // the Suggest class knows everything about every single dictionary. mDicTypeId = Suggest.DIC_MAIN; - if (useFullEditDistance) { - mFlags = FLAG_USE_FULL_EDIT_DISTANCE; - } else { - mFlags = 0; - } + mUseFullEditDistance = useFullEditDistance; loadDictionary(filename, offset, length); } @@ -121,8 +112,8 @@ public class BinaryDictionary extends Dictionary { private native void closeNative(long dict); private native boolean isValidWordNative(long dict, char[] word, int wordLength); private native int getSuggestionsNative(long dict, long proximityInfo, int[] xCoordinates, - int[] yCoordinates, int[] inputCodes, int codesSize, int flags, char[] outputChars, - int[] scores); + int[] yCoordinates, int[] inputCodes, int codesSize, boolean useFullEditDistance, + char[] outputChars, int[] scores); private native int getBigramsNative(long dict, char[] prevWord, int prevWordLength, int[] inputCodes, int inputCodesLength, char[] outputChars, int[] scores, int maxWordLength, int maxBigrams); @@ -214,7 +205,7 @@ public class BinaryDictionary extends Dictionary { return getSuggestionsNative( mNativeDict, proximityInfo.getNativeProximityInfo(), codes.getXCoordinates(), codes.getYCoordinates(), mInputCodes, codesSize, - mFlags, outputChars, scores); + mUseFullEditDistance, outputChars, scores); } public static double calcNormalizedScore(String before, String after, int score) { diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index cbdc68075..fa6664b1a 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -108,14 +108,6 @@ public class Suggest implements Dictionary.WordCallback { initAsynchronously(context, dictionaryResId, locale); } - // TODO: remove when the tests are updated - /* package for test */ Suggest(final Context context, final File dictionary, - final long startOffset, final long length, final Flag[] flagArray, - final Locale locale) { - initSynchronously(context, DictionaryFactory.createDictionaryForTest(context, dictionary, - startOffset, length /* useFullEditDistance */, false, locale), locale); - } - /* package for test */ Suggest(final Context context, final File dictionary, final long startOffset, final long length, final Locale locale) { initSynchronously(context, DictionaryFactory.createDictionaryForTest(context, dictionary, |