aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-03-09 18:24:41 +0900
committerJean Chalard <jchalard@google.com>2012-03-09 18:59:20 +0900
commita333ff19ef330c93287cfa0f6568d0cdcd431b04 (patch)
tree311e88c68afae422f1355d163412045dfb3ee2f2 /java/src/com/android/inputmethod/latin/LatinIME.java
parenta3ee019331e2d8881e19185fba9ccebfeb170614 (diff)
downloadlatinime-a333ff19ef330c93287cfa0f6568d0cdcd431b04.tar.gz
latinime-a333ff19ef330c93287cfa0f6568d0cdcd431b04.tar.xz
latinime-a333ff19ef330c93287cfa0f6568d0cdcd431b04.zip
Reduction, step 7
Change-Id: I177ef2f29c8b6000c5e3d021c016c5d216fe3fc6
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 2ddb53f18..439f1258f 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -2034,12 +2034,16 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
return;
}
- final CharSequence prevWord = EditingUtils.getThisWord(getCurrentInputConnection(),
- mSettingsValues.mWordSeparators);
- SuggestedWords.Builder builder = mSuggest.getBigramPredictionWordBuilder(prevWord,
- mCorrectionMode);
+ final SuggestedWords.Builder builder;
+ if (mCorrectionMode == Suggest.CORRECTION_FULL_BIGRAM) {
+ final CharSequence prevWord = EditingUtils.getThisWord(getCurrentInputConnection(),
+ mSettingsValues.mWordSeparators);
+ builder = mSuggest.getBigramPredictionWordBuilder(prevWord);
+ } else {
+ builder = null;
+ }
- if (builder.size() > 0) {
+ if (null == builder || builder.size() > 0) {
// Explicitly supply an empty typed word (the no-second-arg version of
// showSuggestions will retrieve the word near the cursor, we don't want that here)
showSuggestions(builder.build(), "");