From 9a289da4e6ea40417422a540e821069d5d6e4a82 Mon Sep 17 00:00:00 2001 From: Dan Zivkovic Date: Wed, 11 Mar 2015 14:23:22 -0700 Subject: [PATCH] Remove deprecated distractor filtering methods. Change-Id: I10ccf75d9c00d66b4e85de6c3c019242f2e90b0e --- .../latin/DictionaryFacilitator.java | 7 ------ .../latin/DictionaryFacilitatorImpl.java | 24 ++----------------- .../android/inputmethod/latin/LatinIME.java | 10 +------- 3 files changed, 3 insertions(+), 38 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/DictionaryFacilitator.java b/java/src/com/android/inputmethod/latin/DictionaryFacilitator.java index 3b120f390..b65888997 100644 --- a/java/src/com/android/inputmethod/latin/DictionaryFacilitator.java +++ b/java/src/com/android/inputmethod/latin/DictionaryFacilitator.java @@ -89,9 +89,6 @@ public interface DictionaryFacilitator { void onUpdateMainDictionaryAvailability(boolean isMainDictionaryAvailable); } - // TODO: remove this, it's confusing with seamless multiple language switching - void setIsMonolingualUser(final boolean isMonolingualUser); - boolean isActive(); /** @@ -165,10 +162,6 @@ public interface DictionaryFacilitator { boolean isValidSuggestionWord(final String word); - int getFrequency(final String word); - - int getMaxFrequencyOfExactMatches(final String word); - void clearUserHistoryDictionary(final Context context); String dump(final Context context); diff --git a/java/src/com/android/inputmethod/latin/DictionaryFacilitatorImpl.java b/java/src/com/android/inputmethod/latin/DictionaryFacilitatorImpl.java index e68f8f767..e0b0b2b7e 100644 --- a/java/src/com/android/inputmethod/latin/DictionaryFacilitatorImpl.java +++ b/java/src/com/android/inputmethod/latin/DictionaryFacilitatorImpl.java @@ -230,10 +230,6 @@ public class DictionaryFacilitatorImpl implements DictionaryFacilitator { public DictionaryFacilitatorImpl() { } - // TODO: remove this, it's confusing with seamless multiple language switching - public void setIsMonolingualUser(final boolean isMonolingualUser) { - } - public boolean isActive() { return null != mDictionaryGroups[0].mLocale; } @@ -730,8 +726,7 @@ public class DictionaryFacilitatorImpl implements DictionaryFacilitator { return false; } - private int getFrequencyInternal(final String word, - final boolean isGettingMaxFrequencyOfExactMatches) { + private int getFrequency(final String word) { if (TextUtils.isEmpty(word)) { return Dictionary.NOT_A_PROBABILITY; } @@ -741,12 +736,7 @@ public class DictionaryFacilitatorImpl implements DictionaryFacilitator { for (final String dictType : ALL_DICTIONARY_TYPES) { final Dictionary dictionary = dictionaryGroup.getDict(dictType); if (dictionary == null) continue; - final int tempFreq; - if (isGettingMaxFrequencyOfExactMatches) { - tempFreq = dictionary.getMaxFrequencyOfExactMatches(word); - } else { - tempFreq = dictionary.getFrequency(word); - } + final int tempFreq = dictionary.getFrequency(word); if (tempFreq >= maxFreq) { maxFreq = tempFreq; } @@ -755,16 +745,6 @@ public class DictionaryFacilitatorImpl implements DictionaryFacilitator { return maxFreq; } - @Override - public int getFrequency(final String word) { - return getFrequencyInternal(word, false /* isGettingMaxFrequencyOfExactMatches */); - } - - @Override - public int getMaxFrequencyOfExactMatches(final String word) { - return getFrequencyInternal(word, true /* isGettingMaxFrequencyOfExactMatches */); - } - private void clearSubDictionary(final String dictName) { final DictionaryGroup[] dictionaryGroups = mDictionaryGroups; for (final DictionaryGroup dictionaryGroup : dictionaryGroups) { diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index ec7b5f801..4ae47f377 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -609,15 +609,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen private void refreshPersonalizationDictionarySession( final SettingsValues currentSettingsValues) { - mDictionaryFacilitator.setIsMonolingualUser( - mRichImm.isSystemLocaleSameAsLocaleOfAllEnabledSubtypesOfEnabledImes()); - final boolean shouldKeepUserHistoryDictionaries; - if (currentSettingsValues.mUsePersonalizedDicts) { - shouldKeepUserHistoryDictionaries = true; - } else { - shouldKeepUserHistoryDictionaries = false; - } - if (!shouldKeepUserHistoryDictionaries) { + if (!currentSettingsValues.mUsePersonalizedDicts) { // Remove user history dictionaries. PersonalizationHelper.removeAllUserHistoryDictionaries(this); mDictionaryFacilitator.clearUserHistoryDictionary(this);