aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-06-26 01:52:18 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-06-26 01:52:18 -0700
commit1822388727a5ffb97292829e72c51bc159d27c92 (patch)
treec5de51e2ee172be50f04747d89ffbae278658aa8 /java/src
parent2db68fcfdbdaf86beb60fb3607fd8bc56dc3b649 (diff)
parentfd998bd37a6373beb858d8d3c859c69b65776d4d (diff)
downloadlatinime-1822388727a5ffb97292829e72c51bc159d27c92.tar.gz
latinime-1822388727a5ffb97292829e72c51bc159d27c92.tar.xz
latinime-1822388727a5ffb97292829e72c51bc159d27c92.zip
Merge "Refactoring (A11)"
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/Suggest.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index 67c03f626..fb9de5062 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -239,15 +239,19 @@ public class Suggest implements Dictionary.WordCallback {
if (wordComposer.size() <= 1 && isCorrectionEnabled) {
// At first character typed, search only the bigrams
if (!TextUtils.isEmpty(prevWordForBigram)) {
+ final CharSequence lowerPrevWord;
if (StringUtils.hasUpperCase(prevWordForBigram)) {
// TODO: Must pay attention to locale when changing case.
- final CharSequence lowerPrevWord = prevWordForBigram.toString().toLowerCase();
- for (final Dictionary dictionary : mBigramDictionaries.values()) {
- dictionary.getBigrams(wordComposer, lowerPrevWord, this);
- }
+ lowerPrevWord = prevWordForBigram.toString().toLowerCase();
+ } else {
+ lowerPrevWord = null;
}
- for (final Dictionary dictionary : mBigramDictionaries.values()) {
+ for (final String key : mBigramDictionaries.keySet()) {
+ final Dictionary dictionary = mBigramDictionaries.get(key);
dictionary.getBigrams(wordComposer, prevWordForBigram, this);
+ if (null != lowerPrevWord) {
+ dictionary.getBigrams(wordComposer, lowerPrevWord, this);
+ }
}
}
} else if (wordComposer.size() > 1) {