Skip to content
Snippets Groups Projects
Commit fd998bd3 authored by Jean Chalard's avatar Jean Chalard
Browse files

Refactoring (A11)

Change-Id: I86bd7587dd80773a51ba6db312ba55dc41e7c8c7
parent 64dad2d5
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment