diff options
author | 2012-03-27 01:16:48 -0700 | |
---|---|---|
committer | 2012-03-27 01:16:48 -0700 | |
commit | e0e3e8bb26825d9186fc1eb6a69044d0e4da9f68 (patch) | |
tree | e516d8e752b1d9c9260125239791b89bf292ee80 /java/src/com/android/inputmethod/latin/ExpandableDictionary.java | |
parent | 93070d085d1972be621b0b64901d2ba7fb652bd7 (diff) | |
parent | 01ab7c8b59a7f12862fbd95fb252e56719f1757f (diff) | |
download | latinime-e0e3e8bb26825d9186fc1eb6a69044d0e4da9f68.tar.gz latinime-e0e3e8bb26825d9186fc1eb6a69044d0e4da9f68.tar.xz latinime-e0e3e8bb26825d9186fc1eb6a69044d0e4da9f68.zip |
Merge "ongoing cleanup 2"
Diffstat (limited to '')
-rw-r--r-- | java/src/com/android/inputmethod/latin/ExpandableDictionary.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/ExpandableDictionary.java b/java/src/com/android/inputmethod/latin/ExpandableDictionary.java index 8e8adc1c2..f8de029bd 100644 --- a/java/src/com/android/inputmethod/latin/ExpandableDictionary.java +++ b/java/src/com/android/inputmethod/latin/ExpandableDictionary.java @@ -210,7 +210,11 @@ public class ExpandableDictionary extends Dictionary { if (mCodes.length < mInputLength) mCodes = new int[mInputLength][]; // Cache the codes so that we don't have to lookup an array list for (int i = 0; i < mInputLength; i++) { - mCodes[i] = codes.getCodesAt(i); + // TODO: Calculate proximity info here. + if (mCodes[i] == null || mCodes[i].length < 1) { + mCodes[i] = new int[1]; + } + mCodes[i][0] = codes.getCodeAt(i); } mMaxDepth = mInputLength * 3; getWordsRec(mRoots, codes, mWordBuilder, 0, false, 1, 0, -1, callback); @@ -319,7 +323,7 @@ public class ExpandableDictionary extends Dictionary { } } else { // Don't use alternatives if we're looking for missing characters - final int alternativesSize = skipPos >= 0? 1 : currentChars.length; + final int alternativesSize = skipPos >= 0 ? 1 : currentChars.length; for (int j = 0; j < alternativesSize; j++) { final int addedAttenuation = (j > 0 ? 1 : 2); final int currentChar = currentChars[j]; |