Merge "Add clearContextualDictionary()."
commit
6aa64e91ed
|
@ -564,24 +564,25 @@ public class DictionaryFacilitator {
|
||||||
return getFrequencyInternal(word, true /* isGettingMaxFrequencyOfExactMatches */);
|
return getFrequencyInternal(word, true /* isGettingMaxFrequencyOfExactMatches */);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearUserHistoryDictionary() {
|
private void clearSubDictionary(final String dictName) {
|
||||||
final ExpandableBinaryDictionary userHistoryDict =
|
final ExpandableBinaryDictionary dictionary = mDictionaries.getSubDict(dictName);
|
||||||
mDictionaries.getSubDict(Dictionary.TYPE_USER_HISTORY);
|
if (dictionary != null) {
|
||||||
if (userHistoryDict == null) {
|
dictionary.clear();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
userHistoryDict.clear();
|
}
|
||||||
|
|
||||||
|
public void clearUserHistoryDictionary() {
|
||||||
|
clearSubDictionary(Dictionary.TYPE_USER_HISTORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method gets called only when the IME receives a notification to remove the
|
// This method gets called only when the IME receives a notification to remove the
|
||||||
// personalization dictionary.
|
// personalization dictionary.
|
||||||
public void clearPersonalizationDictionary() {
|
public void clearPersonalizationDictionary() {
|
||||||
final ExpandableBinaryDictionary personalizationDict =
|
clearSubDictionary(Dictionary.TYPE_PERSONALIZATION);
|
||||||
mDictionaries.getSubDict(Dictionary.TYPE_PERSONALIZATION);
|
|
||||||
if (personalizationDict == null) {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
personalizationDict.clear();
|
|
||||||
|
public void clearContextualDictionary() {
|
||||||
|
clearSubDictionary(Dictionary.TYPE_CONTEXTUAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addEntriesToPersonalizationDictionary(
|
public void addEntriesToPersonalizationDictionary(
|
||||||
|
|
Loading…
Reference in New Issue