Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 18223887 authored by Jean Chalard's avatar Jean Chalard Committed by Android (Google) Code Review
Browse files

Merge "Refactoring (A11)"

parents 2db68fcf fd998bd3
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -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) {