diff options
author | 2011-04-22 13:08:35 +0900 | |
---|---|---|
committer | 2011-04-22 15:53:48 +0900 | |
commit | b50591295d7c4ff7bb46ddf3e609d0046eb64d18 (patch) | |
tree | 306a28d4a659881abf4de03c16d46094e6424ec6 /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | 89bd776cf68150202d774d62cc1c88664aea5e9f (diff) | |
download | latinime-b50591295d7c4ff7bb46ddf3e609d0046eb64d18.tar.gz latinime-b50591295d7c4ff7bb46ddf3e609d0046eb64d18.tar.xz latinime-b50591295d7c4ff7bb46ddf3e609d0046eb64d18.zip |
Add an option for using bigram prediction.
This change adds the option for bigram prediction under the option
for bigram suggestion. The "prediction" option depends on the
"suggestion" option.
This change also reorders a tad bit the settings screen. Namely, it
sticks both bigram options under a "bigram" category, and groups the
options that did not have a group under a "other options", or misc,
category.
Finally this change also renames the internal name of the "text
corrections" option category to "correction_category" instead of
"prediction_category" which was misleading.
Change-Id: I2d8787c8a391fd8202ed3a686c613494b7260a1e
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 8f44ec743..05691b224 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -177,7 +177,10 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar private boolean mJustAddedAutoSpace; private boolean mAutoCorrectEnabled; private boolean mRecorrectionEnabled; + // Suggestion: use bigrams to adjust scores of suggestions obtained from unigram dictionary private boolean mBigramSuggestionEnabled; + // Prediction: use bigrams to predict the next word when there is no input for it yet + private boolean mBigramPredictionEnabled; private boolean mAutoCorrectOn; private boolean mVibrateOn; private boolean mSoundOn; @@ -2200,6 +2203,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar mAutoCorrectEnabled = isAutoCorrectEnabled(prefs); mBigramSuggestionEnabled = mAutoCorrectEnabled && isBigramSuggestionEnabled(prefs); + mBigramPredictionEnabled = mBigramSuggestionEnabled && isBigramPredictionEnabled(prefs); loadAndSetAutoCorrectionThreshold(prefs); mVoiceProxy.loadSettings(attribute, prefs); @@ -2284,6 +2288,11 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar R.bool.config_default_bigram_suggestions)); } + private boolean isBigramPredictionEnabled(SharedPreferences sp) { + return sp.getBoolean(Settings.PREF_BIGRAM_PREDICTIONS, mResources.getBoolean( + R.bool.config_default_bigram_prediction)); + } + private void initSuggestPuncList() { if (mSuggestPuncs != null || mSuggestPuncList != null) return; |