aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/Suggest.java
diff options
context:
space:
mode:
authorKen Wakasa <kwakasa@google.com>2011-01-16 23:18:16 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-01-16 23:18:16 -0800
commitcdb756ac62a6a9274a137159d50b7ca9cb8c4370 (patch)
tree151823887f0052e0561995aaee4eb1e652c8af9f /java/src/com/android/inputmethod/latin/Suggest.java
parent41b433a118140bf31577b8ed8362e0a4326c601c (diff)
parent00764eda3ff59b6021dcbc444120dc11495f0072 (diff)
downloadlatinime-cdb756ac62a6a9274a137159d50b7ca9cb8c4370.tar.gz
latinime-cdb756ac62a6a9274a137159d50b7ca9cb8c4370.tar.xz
latinime-cdb756ac62a6a9274a137159d50b7ca9cb8c4370.zip
am 00764eda: am 3ff0fb77: Merge "Fixes in close() in BinaryDictionary." into honeycomb
* commit '00764eda3ff59b6021dcbc444120dc11495f0072': Fixes in close() in BinaryDictionary.
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Suggest.java')
-rw-r--r--java/src/com/android/inputmethod/latin/Suggest.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index 9ea9c2f3e..a8454b23e 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -103,7 +103,7 @@ public class Suggest implements Dictionary.WordCallback {
private int mCorrectionMode = CORRECTION_BASIC;
public Suggest(Context context, int dictionaryResId) {
- mMainDict = new BinaryDictionary(context, dictionaryResId, DIC_MAIN);
+ mMainDict = BinaryDictionary.initDictionary(context, dictionaryResId, DIC_MAIN);
initPool();
}
@@ -127,7 +127,7 @@ public class Suggest implements Dictionary.WordCallback {
}
public boolean hasMainDictionary() {
- return mMainDict.getSize() > LARGE_DICTIONARY_THRESHOLD;
+ return mMainDict != null && mMainDict.getSize() > LARGE_DICTIONARY_THRESHOLD;
}
public int getApproxMaxWordLength() {
@@ -276,7 +276,7 @@ public class Suggest implements Dictionary.WordCallback {
mHaveCorrection = true;
}
}
- mMainDict.getWords(wordComposer, this, mNextLettersFrequencies);
+ if (mMainDict != null) mMainDict.getWords(wordComposer, this, mNextLettersFrequencies);
if ((mCorrectionMode == CORRECTION_FULL || mCorrectionMode == CORRECTION_FULL_BIGRAM)
&& mSuggestions.size() > 0 && mPriorities.length > 0) {
// TODO: when the normalized score of the first suggestion is nearly equals to
@@ -496,7 +496,7 @@ public class Suggest implements Dictionary.WordCallback {
}
public boolean isValidWord(final CharSequence word) {
- if (word == null || word.length() == 0) {
+ if (word == null || word.length() == 0 || mMainDict == null) {
return false;
}
return mMainDict.isValidWord(word)