Loading java/src/com/android/inputmethod/latin/LatinIME.java +5 −6 Original line number Diff line number Diff line Loading @@ -1768,9 +1768,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar final CharSequence typedWord = mWordComposer.getTypedWord(); // getSuggestedWordBuilder handles gracefully a null value of prevWord final SuggestedWords.Builder builder = mSuggest.getSuggestedWordBuilder(mWordComposer, final SuggestedWords suggestedWords = mSuggest.getSuggestedWords(mWordComposer, prevWord, mKeyboardSwitcher.getKeyboard().getProximityInfo(), mCorrectionMode); final SuggestedWords suggestions = builder.build(); // Basically, we update the suggestion strip only when suggestion count > 1. However, // there is an exception: We update the suggestion strip whenever typed word's length Loading @@ -1778,10 +1777,10 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // in most cases, suggestion count is 1 when typed word's length is 1, but we do always // need to clear the previous state when the user starts typing a word (i.e. typed word's // length == 1). if (suggestions.size() > 1 || typedWord.length() == 1 || !suggestions.mAllowsToBeAutoCorrected if (suggestedWords.size() > 1 || typedWord.length() == 1 || !suggestedWords.mAllowsToBeAutoCorrected || mSuggestionsView.isShowingAddToDictionaryHint()) { showSuggestions(suggestions, typedWord); showSuggestions(suggestedWords, typedWord); } else { SuggestedWords previousSuggestions = mSuggestionsView.getSuggestions(); if (previousSuggestions == mSettingsValues.mSuggestPuncList) { Loading Loading @@ -1982,7 +1981,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar final CharSequence prevWord = EditingUtils.getThisWord(getCurrentInputConnection(), mSettingsValues.mWordSeparators); if (!TextUtils.isEmpty(prevWord)) { suggestedWords = mSuggest.getBigramPredictionWordBuilder(prevWord).build(); suggestedWords = mSuggest.getBigramPredictions(prevWord); } else { suggestedWords = null; } Loading java/src/com/android/inputmethod/latin/Suggest.java +5 −7 Original line number Diff line number Diff line Loading @@ -239,7 +239,7 @@ public class Suggest implements Dictionary.WordCallback { } private static final WordComposer sEmptyWordComposer = new WordComposer(); public SuggestedWords.Builder getBigramPredictionWordBuilder(CharSequence prevWordForBigram) { public SuggestedWords getBigramPredictions(CharSequence prevWordForBigram) { LatinImeLogger.onStartSuggestion(prevWordForBigram); mIsFirstCharCapitalized = false; mIsAllUpperCase = false; Loading Loading @@ -275,11 +275,11 @@ public class Suggest implements Dictionary.WordCallback { false /* hasMinimalSuggestion */, false /* allowsToBeAutoCorrected */, false /* isPunctuationSuggestions */, false /* shouldBlockAutoCorrectionBySafetyNet */); false /* shouldBlockAutoCorrectionBySafetyNet */).build(); } // TODO: cleanup dictionaries looking up and suggestions building with SuggestedWords.Builder public SuggestedWords.Builder getSuggestedWordBuilder( public SuggestedWords getSuggestedWords( final WordComposer wordComposer, CharSequence prevWordForBigram, final ProximityInfo proximityInfo, final int correctionMode) { LatinImeLogger.onStartSuggestion(prevWordForBigram); Loading Loading @@ -393,7 +393,6 @@ public class Suggest implements Dictionary.WordCallback { mSuggestions.add(0, typedWord); StringUtils.removeDupes(mSuggestions); final SuggestedWords.Builder builder; final ArrayList<SuggestedWords.SuggestedWordInfo> scoreInfoList; if (DBG) { // TODO: this doesn't take into account the fact that removing dupes from mSuggestions Loading Loading @@ -446,13 +445,12 @@ public class Suggest implements Dictionary.WordCallback { } else { shouldBlockAutoCorrectionBySatefyNet = false; } builder = new SuggestedWords.Builder(scoreInfoList, return new SuggestedWords.Builder(scoreInfoList, !allowsToBeAutoCorrected /* typedWordValid */, autoCorrectionAvailable /* hasMinimalSuggestion */, allowsToBeAutoCorrected /* allowsToBeAutoCorrected */, false /* isPunctuationSuggestions */, shouldBlockAutoCorrectionBySatefyNet); return builder; shouldBlockAutoCorrectionBySatefyNet).build(); } @Override Loading Loading
java/src/com/android/inputmethod/latin/LatinIME.java +5 −6 Original line number Diff line number Diff line Loading @@ -1768,9 +1768,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar final CharSequence typedWord = mWordComposer.getTypedWord(); // getSuggestedWordBuilder handles gracefully a null value of prevWord final SuggestedWords.Builder builder = mSuggest.getSuggestedWordBuilder(mWordComposer, final SuggestedWords suggestedWords = mSuggest.getSuggestedWords(mWordComposer, prevWord, mKeyboardSwitcher.getKeyboard().getProximityInfo(), mCorrectionMode); final SuggestedWords suggestions = builder.build(); // Basically, we update the suggestion strip only when suggestion count > 1. However, // there is an exception: We update the suggestion strip whenever typed word's length Loading @@ -1778,10 +1777,10 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // in most cases, suggestion count is 1 when typed word's length is 1, but we do always // need to clear the previous state when the user starts typing a word (i.e. typed word's // length == 1). if (suggestions.size() > 1 || typedWord.length() == 1 || !suggestions.mAllowsToBeAutoCorrected if (suggestedWords.size() > 1 || typedWord.length() == 1 || !suggestedWords.mAllowsToBeAutoCorrected || mSuggestionsView.isShowingAddToDictionaryHint()) { showSuggestions(suggestions, typedWord); showSuggestions(suggestedWords, typedWord); } else { SuggestedWords previousSuggestions = mSuggestionsView.getSuggestions(); if (previousSuggestions == mSettingsValues.mSuggestPuncList) { Loading Loading @@ -1982,7 +1981,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar final CharSequence prevWord = EditingUtils.getThisWord(getCurrentInputConnection(), mSettingsValues.mWordSeparators); if (!TextUtils.isEmpty(prevWord)) { suggestedWords = mSuggest.getBigramPredictionWordBuilder(prevWord).build(); suggestedWords = mSuggest.getBigramPredictions(prevWord); } else { suggestedWords = null; } Loading
java/src/com/android/inputmethod/latin/Suggest.java +5 −7 Original line number Diff line number Diff line Loading @@ -239,7 +239,7 @@ public class Suggest implements Dictionary.WordCallback { } private static final WordComposer sEmptyWordComposer = new WordComposer(); public SuggestedWords.Builder getBigramPredictionWordBuilder(CharSequence prevWordForBigram) { public SuggestedWords getBigramPredictions(CharSequence prevWordForBigram) { LatinImeLogger.onStartSuggestion(prevWordForBigram); mIsFirstCharCapitalized = false; mIsAllUpperCase = false; Loading Loading @@ -275,11 +275,11 @@ public class Suggest implements Dictionary.WordCallback { false /* hasMinimalSuggestion */, false /* allowsToBeAutoCorrected */, false /* isPunctuationSuggestions */, false /* shouldBlockAutoCorrectionBySafetyNet */); false /* shouldBlockAutoCorrectionBySafetyNet */).build(); } // TODO: cleanup dictionaries looking up and suggestions building with SuggestedWords.Builder public SuggestedWords.Builder getSuggestedWordBuilder( public SuggestedWords getSuggestedWords( final WordComposer wordComposer, CharSequence prevWordForBigram, final ProximityInfo proximityInfo, final int correctionMode) { LatinImeLogger.onStartSuggestion(prevWordForBigram); Loading Loading @@ -393,7 +393,6 @@ public class Suggest implements Dictionary.WordCallback { mSuggestions.add(0, typedWord); StringUtils.removeDupes(mSuggestions); final SuggestedWords.Builder builder; final ArrayList<SuggestedWords.SuggestedWordInfo> scoreInfoList; if (DBG) { // TODO: this doesn't take into account the fact that removing dupes from mSuggestions Loading Loading @@ -446,13 +445,12 @@ public class Suggest implements Dictionary.WordCallback { } else { shouldBlockAutoCorrectionBySatefyNet = false; } builder = new SuggestedWords.Builder(scoreInfoList, return new SuggestedWords.Builder(scoreInfoList, !allowsToBeAutoCorrected /* typedWordValid */, autoCorrectionAvailable /* hasMinimalSuggestion */, allowsToBeAutoCorrected /* allowsToBeAutoCorrected */, false /* isPunctuationSuggestions */, shouldBlockAutoCorrectionBySatefyNet); return builder; shouldBlockAutoCorrectionBySatefyNet).build(); } @Override Loading