am 6aa64e91: Merge "Add clearContextualDictionary()."

* commit '6aa64e91ed431717f22b9621b424b04b270b32ae':
  Add clearContextualDictionary().
main
Keisuke Kuroyanagi 2014-06-16 08:46:34 +00:00 committed by Android Git Automerger
commit 7edd957e70
1 changed files with 13 additions and 12 deletions

View File

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