Refactoring (A11)

Change-Id: I86bd7587dd80773a51ba6db312ba55dc41e7c8c7
main
Jean Chalard 2012-06-26 15:29:01 +09:00
parent 64dad2d5a9
commit fd998bd37a
1 changed files with 9 additions and 5 deletions

View File

@ -239,16 +239,20 @@ public class Suggest implements Dictionary.WordCallback {
if (wordComposer.size() <= 1 && isCorrectionEnabled) { if (wordComposer.size() <= 1 && isCorrectionEnabled) {
// At first character typed, search only the bigrams // At first character typed, search only the bigrams
if (!TextUtils.isEmpty(prevWordForBigram)) { if (!TextUtils.isEmpty(prevWordForBigram)) {
final CharSequence lowerPrevWord;
if (StringUtils.hasUpperCase(prevWordForBigram)) { if (StringUtils.hasUpperCase(prevWordForBigram)) {
// TODO: Must pay attention to locale when changing case. // TODO: Must pay attention to locale when changing case.
final CharSequence lowerPrevWord = prevWordForBigram.toString().toLowerCase(); lowerPrevWord = prevWordForBigram.toString().toLowerCase();
for (final Dictionary dictionary : mBigramDictionaries.values()) { } else {
lowerPrevWord = null;
}
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); dictionary.getBigrams(wordComposer, lowerPrevWord, this);
} }
} }
for (final Dictionary dictionary : mBigramDictionaries.values()) {
dictionary.getBigrams(wordComposer, prevWordForBigram, this);
}
} }
} else if (wordComposer.size() > 1) { } else if (wordComposer.size() > 1) {
final WordComposer wordComposerForLookup; final WordComposer wordComposerForLookup;