diff options
author | 2010-12-01 19:09:29 +0900 | |
---|---|---|
committer | 2010-12-01 19:26:36 +0900 | |
commit | d4952c8fe9e71c2b313a68077e03d64c8b5196db (patch) | |
tree | ff2882312ca417dbe5c2efc5b09412ff72f5ebdd /java/src/com/android/inputmethod/latin/BinaryDictionary.java | |
parent | bd20db25be46e342c5a66b00edc8d0fc845da22b (diff) | |
download | latinime-d4952c8fe9e71c2b313a68077e03d64c8b5196db.tar.gz latinime-d4952c8fe9e71c2b313a68077e03d64c8b5196db.tar.xz latinime-d4952c8fe9e71c2b313a68077e03d64c8b5196db.zip |
Move a logic for finding words with a missing character to the native code.
Change-Id: I58338643830ff4f9708f78a9c26f75c8bf2ebf45
Diffstat (limited to 'java/src/com/android/inputmethod/latin/BinaryDictionary.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/BinaryDictionary.java | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java index 4e02f84d9..95c773855 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java @@ -45,7 +45,6 @@ public class BinaryDictionary extends Dictionary { private static final int MAX_BIGRAMS = 60; private static final int TYPED_LETTER_MULTIPLIER = 2; - private static final boolean ENABLE_MISSED_CHARACTERS = true; private int mDicTypeId; private int mNativeDict; @@ -199,27 +198,11 @@ public class BinaryDictionary extends Dictionary { Arrays.fill(mOutputChars, (char) 0); Arrays.fill(mFrequencies, 0); - int count = getSuggestionsNative(mNativeDict, mInputCodes, codesSize, - mOutputChars, mFrequencies, - MAX_WORD_LENGTH, MAX_WORDS, MAX_ALTERNATIVES, -1, + int count = getSuggestionsNative(mNativeDict, mInputCodes, codesSize, mOutputChars, + mFrequencies, MAX_WORD_LENGTH, MAX_WORDS, MAX_ALTERNATIVES, -1, nextLettersFrequencies, nextLettersFrequencies != null ? nextLettersFrequencies.length : 0); - // If there aren't sufficient suggestions, search for words by allowing wild cards at - // the different character positions. This feature is not ready for prime-time as we need - // to figure out the best ranking for such words compared to proximity corrections and - // completions. - if (ENABLE_MISSED_CHARACTERS && count < 5) { - for (int skip = 0; skip < codesSize; skip++) { - int tempCount = getSuggestionsNative(mNativeDict, mInputCodes, codesSize, - mOutputChars, mFrequencies, - MAX_WORD_LENGTH, MAX_WORDS, MAX_ALTERNATIVES, skip, - null, 0); - count = Math.max(count, tempCount); - if (tempCount > 0) break; - } - } - for (int j = 0; j < count; j++) { if (mFrequencies[j] < 1) break; int start = j * MAX_WORD_LENGTH; |