am 9a289da4: Remove deprecated distractor filtering methods.

* commit '9a289da4e6ea40417422a540e821069d5d6e4a82':
  Remove deprecated distractor filtering methods.
main
Dan Zivkovic 2015-03-11 23:16:01 +00:00 committed by Android Git Automerger
commit 9a2e1ef6b4
3 changed files with 3 additions and 38 deletions

View File

@ -89,9 +89,6 @@ public interface DictionaryFacilitator {
void onUpdateMainDictionaryAvailability(boolean isMainDictionaryAvailable); void onUpdateMainDictionaryAvailability(boolean isMainDictionaryAvailable);
} }
// TODO: remove this, it's confusing with seamless multiple language switching
void setIsMonolingualUser(final boolean isMonolingualUser);
boolean isActive(); boolean isActive();
/** /**
@ -165,10 +162,6 @@ public interface DictionaryFacilitator {
boolean isValidSuggestionWord(final String word); boolean isValidSuggestionWord(final String word);
int getFrequency(final String word);
int getMaxFrequencyOfExactMatches(final String word);
void clearUserHistoryDictionary(final Context context); void clearUserHistoryDictionary(final Context context);
String dump(final Context context); String dump(final Context context);

View File

@ -230,10 +230,6 @@ public class DictionaryFacilitatorImpl implements DictionaryFacilitator {
public DictionaryFacilitatorImpl() { public DictionaryFacilitatorImpl() {
} }
// TODO: remove this, it's confusing with seamless multiple language switching
public void setIsMonolingualUser(final boolean isMonolingualUser) {
}
public boolean isActive() { public boolean isActive() {
return null != mDictionaryGroups[0].mLocale; return null != mDictionaryGroups[0].mLocale;
} }
@ -730,8 +726,7 @@ public class DictionaryFacilitatorImpl implements DictionaryFacilitator {
return false; return false;
} }
private int getFrequencyInternal(final String word, private int getFrequency(final String word) {
final boolean isGettingMaxFrequencyOfExactMatches) {
if (TextUtils.isEmpty(word)) { if (TextUtils.isEmpty(word)) {
return Dictionary.NOT_A_PROBABILITY; return Dictionary.NOT_A_PROBABILITY;
} }
@ -741,12 +736,7 @@ public class DictionaryFacilitatorImpl implements DictionaryFacilitator {
for (final String dictType : ALL_DICTIONARY_TYPES) { for (final String dictType : ALL_DICTIONARY_TYPES) {
final Dictionary dictionary = dictionaryGroup.getDict(dictType); final Dictionary dictionary = dictionaryGroup.getDict(dictType);
if (dictionary == null) continue; if (dictionary == null) continue;
final int tempFreq; final int tempFreq = dictionary.getFrequency(word);
if (isGettingMaxFrequencyOfExactMatches) {
tempFreq = dictionary.getMaxFrequencyOfExactMatches(word);
} else {
tempFreq = dictionary.getFrequency(word);
}
if (tempFreq >= maxFreq) { if (tempFreq >= maxFreq) {
maxFreq = tempFreq; maxFreq = tempFreq;
} }
@ -755,16 +745,6 @@ public class DictionaryFacilitatorImpl implements DictionaryFacilitator {
return maxFreq; 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) { private void clearSubDictionary(final String dictName) {
final DictionaryGroup[] dictionaryGroups = mDictionaryGroups; final DictionaryGroup[] dictionaryGroups = mDictionaryGroups;
for (final DictionaryGroup dictionaryGroup : dictionaryGroups) { for (final DictionaryGroup dictionaryGroup : dictionaryGroups) {

View File

@ -609,15 +609,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
private void refreshPersonalizationDictionarySession( private void refreshPersonalizationDictionarySession(
final SettingsValues currentSettingsValues) { final SettingsValues currentSettingsValues) {
mDictionaryFacilitator.setIsMonolingualUser( if (!currentSettingsValues.mUsePersonalizedDicts) {
mRichImm.isSystemLocaleSameAsLocaleOfAllEnabledSubtypesOfEnabledImes());
final boolean shouldKeepUserHistoryDictionaries;
if (currentSettingsValues.mUsePersonalizedDicts) {
shouldKeepUserHistoryDictionaries = true;
} else {
shouldKeepUserHistoryDictionaries = false;
}
if (!shouldKeepUserHistoryDictionaries) {
// Remove user history dictionaries. // Remove user history dictionaries.
PersonalizationHelper.removeAllUserHistoryDictionaries(this); PersonalizationHelper.removeAllUserHistoryDictionaries(this);
mDictionaryFacilitator.clearUserHistoryDictionary(this); mDictionaryFacilitator.clearUserHistoryDictionary(this);