Remove deprecated distractor filtering methods.
Change-Id: I10ccf75d9c00d66b4e85de6c3c019242f2e90b0emain
parent
7472cc8245
commit
9a289da4e6
|
@ -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);
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue