From ea077349563d704dc3fdecf31a6f9f7f95ce4ad4 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Tue, 7 Oct 2014 14:29:14 +0900 Subject: [ML15] First step in removing DictionaryFacilitator.getLocale Bug: 11230254 Change-Id: Ied010ec6f1024080e8a499f682d2fc1780e82ef7 --- java/src/com/android/inputmethod/latin/Suggest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'java/src/com/android/inputmethod/latin/Suggest.java') diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index d2d9b9b1e..e181237a6 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -55,10 +55,6 @@ public final class Suggest { mDictionaryFacilitator = dictionaryFacilitator; } - public Locale getLocale() { - return mDictionaryFacilitator.getLocale(); - } - public void setAutoCorrectionThreshold(final float threshold) { mAutoCorrectionThreshold = threshold; } @@ -136,7 +132,10 @@ public final class Suggest { SESSION_ID_TYPING); final ArrayList suggestionsContainer = getTransformedSuggestedWordInfoList(wordComposer, suggestionResults, - trailingSingleQuotesCount, mDictionaryFacilitator.getLocale()); + trailingSingleQuotesCount, + // For transforming suggestions that don't come for any dictionary, we + // use the currently most probable locale as it's our best bet. + mDictionaryFacilitator.getMostProbableLocale()); final boolean didRemoveTypedWord = SuggestedWordInfo.removeDups(wordComposer.getTypedWord(), suggestionsContainer); @@ -216,7 +215,8 @@ public final class Suggest { final SuggestionResults suggestionResults = mDictionaryFacilitator.getSuggestionResults( wordComposer, ngramContext, proximityInfo, settingsValuesForSuggestion, SESSION_ID_GESTURE); - final Locale defaultLocale = mDictionaryFacilitator.getLocale(); + // For transforming words that don't come from a dictionary, because it's our best bet + final Locale defaultLocale = mDictionaryFacilitator.getMostProbableLocale(); final ArrayList suggestionsContainer = new ArrayList<>(suggestionResults); final int suggestionsCount = suggestionsContainer.size(); -- cgit v1.2.3-83-g751a