aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/android/inputmethod
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2009-07-15 18:30:47 -0700
committerJean-Baptiste Queru <jbq@google.com>2009-08-13 17:17:27 -0700
commit322dc3d3f3b3ab5b1eacc8ef8cc0fcd7cbed97e3 (patch)
treec6cd7850e7f7f0e0b9a7e4171390be9b2d93c241 /src/com/android/inputmethod
parentc3df2d6fd27f3a5b84040b59aece3367769f0cb6 (diff)
downloadlatinime-322dc3d3f3b3ab5b1eacc8ef8cc0fcd7cbed97e3.tar.gz
latinime-322dc3d3f3b3ab5b1eacc8ef8cc0fcd7cbed97e3.tar.xz
latinime-322dc3d3f3b3ab5b1eacc8ef8cc0fcd7cbed97e3.zip
Prune out suggestions that have a very large edit distance.
If the number of keys picked from proximity is too large, prune out the subtree. Otherwise you get vastly unrelated suggestions. Fix a bug introduced with the missing_chars checkin.
Diffstat (limited to 'src/com/android/inputmethod')
-rw-r--r--src/com/android/inputmethod/latin/BinaryDictionary.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/android/inputmethod/latin/BinaryDictionary.java b/src/com/android/inputmethod/latin/BinaryDictionary.java
index ab66c5b87..836c8034c 100644
--- a/src/com/android/inputmethod/latin/BinaryDictionary.java
+++ b/src/com/android/inputmethod/latin/BinaryDictionary.java
@@ -101,10 +101,11 @@ public class BinaryDictionary extends Dictionary {
// completions.
if (ENABLE_MISSED_CHARACTERS && count < 5) {
for (int skip = 0; skip < codesSize; skip++) {
- count = getSuggestionsNative(mNativeDict, mInputCodes, codesSize,
+ int tempCount = getSuggestionsNative(mNativeDict, mInputCodes, codesSize,
mOutputChars, mFrequencies,
MAX_WORD_LENGTH, MAX_WORDS, MAX_ALTERNATIVES, skip);
- if (count > 0) break;
+ count = Math.max(count, tempCount);
+ if (tempCount > 0) break;
}
}