aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-06-19 09:24:00 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-06-19 09:24:00 -0700
commitbd765d33556def42c41a6f36298f28feb01af8e4 (patch)
treee1a0d8cd6f1db150568f70c3dcf752b6ccd37004 /java
parentb821b72aa174bcb597293428c75b4986bd05b702 (diff)
parent5475e92b3fb33dd7d6b021ddcbe1ca593112b5c8 (diff)
downloadlatinime-bd765d33556def42c41a6f36298f28feb01af8e4.tar.gz
latinime-bd765d33556def42c41a6f36298f28feb01af8e4.tar.xz
latinime-bd765d33556def42c41a6f36298f28feb01af8e4.zip
Merge "Cleanup, part 3 (C3)"
Diffstat (limited to 'java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java2
-rw-r--r--java/src/com/android/inputmethod/latin/SettingsValues.java4
-rw-r--r--java/src/com/android/inputmethod/latin/Suggest.java9
3 files changed, 7 insertions, 8 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 3154676fd..da4a11433 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1928,7 +1928,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 30fee576f..d4317de35 100644
--- a/java/src/com/android/inputmethod/latin/SettingsValues.java
+++ b/java/src/com/android/inputmethod/latin/SettingsValues.java
@@ -209,7 +209,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 938247f00..eb854910d 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;
@@ -266,7 +267,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);
@@ -323,7 +324,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,
@@ -373,7 +374,7 @@ public class Suggest implements Dictionary.WordCallback {
&& hasMainDictionary();
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