diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 107d9344e4f2af2d9374797847f54577c102101a..fc4d1150c0bf233db3e2092e47202f7fb2d32481 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1932,7 +1932,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } final SuggestedWords suggestedWords; - if (mCurrentSettings.mCorrectionMode == Suggest.CORRECTION_FULL_BIGRAM) { + if (mCurrentSettings.isCorrectionOn()) { final CharSequence prevWord = mConnection.getThisWord(mCurrentSettings.mWordSeparators); if (!TextUtils.isEmpty(prevWord)) { suggestedWords = mSuggest.getBigramPredictions(prevWord); diff --git a/java/src/com/android/inputmethod/latin/SettingsValues.java b/java/src/com/android/inputmethod/latin/SettingsValues.java index 772d18ef843bd9ef873f066e74d675ff95a9deb0..106cd2c0cec0d06c83d2682c3d229f1015a041c7 100644 --- a/java/src/com/android/inputmethod/latin/SettingsValues.java +++ b/java/src/com/android/inputmethod/latin/SettingsValues.java @@ -210,7 +210,6 @@ public class SettingsValues { private int createCorrectionMode() { final boolean shouldAutoCorrect = mAutoCorrectEnabled && !mInputAttributes.mInputTypeNoAutoCorrect; - if (shouldAutoCorrect) return Suggest.CORRECTION_FULL_BIGRAM; return shouldAutoCorrect ? Suggest.CORRECTION_FULL : Suggest.CORRECTION_NONE; } @@ -244,8 +243,7 @@ public class SettingsValues { } public boolean isCorrectionOn() { - return mCorrectionMode == Suggest.CORRECTION_FULL - || mCorrectionMode == Suggest.CORRECTION_FULL_BIGRAM; + return mCorrectionMode == Suggest.CORRECTION_FULL; } public boolean isSuggestionStripVisibleInOrientation(final int orientation) { diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index 68b7b913f8ce08861c6a3b8e6b800f2108a25e69..958b4533b1e6dbbbd6c209d05b9d8fbe9be7086c 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -39,9 +39,10 @@ public class Suggest implements Dictionary.WordCallback { public static final int APPROX_MAX_WORD_LENGTH = 32; + // TODO: rename this to CORRECTION_OFF public static final int CORRECTION_NONE = 0; + // TODO: rename this to CORRECTION_ON public static final int CORRECTION_FULL = 1; - public static final int CORRECTION_FULL_BIGRAM = 2; // It seems the following values are only used for logging. public static final int DIC_USER_TYPED = 0; @@ -262,7 +263,7 @@ public class Suggest implements Dictionary.WordCallback { LatinImeLogger.onAddSuggestedWord(typedWord, Suggest.DIC_USER_TYPED, Dictionary.UNIGRAM); mConsideredWord = consideredWord; - if (wordComposer.size() <= 1 && (correctionMode == CORRECTION_FULL_BIGRAM)) { + if (wordComposer.size() <= 1 && (correctionMode == CORRECTION_FULL)) { // At first character typed, search only the bigrams mBigramSuggestions = new ArrayList<SuggestedWordInfo>(PREF_MAX_BIGRAMS); @@ -319,7 +320,7 @@ public class Suggest implements Dictionary.WordCallback { mIsFirstCharCapitalized, mWhiteListDictionary.getWhitelistedWord(consideredWord)); final boolean hasAutoCorrection; - if (CORRECTION_FULL == correctionMode || CORRECTION_FULL_BIGRAM == correctionMode) { + if (CORRECTION_FULL == correctionMode) { final CharSequence autoCorrection = AutoCorrection.computeAutoCorrectionWord(mUnigramDictionaries, wordComposer, mSuggestions, consideredWord, mAutoCorrectionThreshold, @@ -368,7 +369,7 @@ public class Suggest implements Dictionary.WordCallback { && mHasMainDictionary; boolean autoCorrectionAvailable = hasAutoCorrection; - if (correctionMode == CORRECTION_FULL || correctionMode == CORRECTION_FULL_BIGRAM) { + if (correctionMode == CORRECTION_FULL) { autoCorrectionAvailable |= !allowsToBeAutoCorrected; } // Don't auto-correct words with multiple capital letter