diff options
author | 2012-03-27 15:21:54 +0900 | |
---|---|---|
committer | 2012-03-27 16:28:48 +0900 | |
commit | 01ab7c8b59a7f12862fbd95fb252e56719f1757f (patch) | |
tree | 3d52952e02de8a812449aad96766bbe00d005705 /java/src/com/android/inputmethod/latin/ExpandableDictionary.java | |
parent | b79064cbebf82edd61dd8b54361bb692181646bf (diff) | |
download | latinime-01ab7c8b59a7f12862fbd95fb252e56719f1757f.tar.gz latinime-01ab7c8b59a7f12862fbd95fb252e56719f1757f.tar.xz latinime-01ab7c8b59a7f12862fbd95fb252e56719f1757f.zip |
ongoing cleanup 2
Change-Id: I66b61cbe491cf8375144e834390beae3209a777d
Diffstat (limited to 'java/src/com/android/inputmethod/latin/ExpandableDictionary.java')
-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]; |