Home | History | Annotate | Download | only in latin

Lines Matching refs:Dictionary

68     // dictionary.
80 DICT_TYPE_TO_CLASS.put(Dictionary.TYPE_USER_HISTORY, UserHistoryDictionary.class);
81 DICT_TYPE_TO_CLASS.put(Dictionary.TYPE_USER, UserBinaryDictionary.class);
82 DICT_TYPE_TO_CLASS.put(Dictionary.TYPE_CONTACTS, ContactsBinaryDictionary.class);
128 * The locale associated with the dictionary group.
133 * The user account associated with the dictionary group.
137 @Nullable private Dictionary mMainDict;
154 @Nullable final Dictionary mainDict,
159 // The main dictionary can be asynchronously loaded.
172 public void setMainDict(final Dictionary mainDict) {
173 // Close old dictionary if exists. Main dictionary can be assigned multiple times.
174 final Dictionary oldDict = mMainDict;
181 public Dictionary getDict(final String dictType) {
182 if (Dictionary.TYPE_MAIN.equals(dictType)) {
193 if (Dictionary.TYPE_MAIN.equals(dictType)) {
196 if (Dictionary.TYPE_USER_HISTORY.equals(dictType) &&
198 // If the dictionary type is user history, & if the account doesn't match,
200 // sub dictionary map.
207 final Dictionary dict;
208 if (Dictionary.TYPE_MAIN.equals(dictType)) {
242 return mDictionaryGroup.getSubDict(Dictionary.TYPE_CONTACTS) != null;
267 Log.e(TAG, "Cannot create dictionary: " + dictType, e);
291 subDictTypesToUse.add(Dictionary.TYPE_USER);
293 // Do not use contacts dictionary if we do not have permissions to read contacts.
297 subDictTypesToUse.add(Dictionary.TYPE_CONTACTS);
300 subDictTypesToUse.add(Dictionary.TYPE_USER_HISTORY);
314 if (currentDictionaryGroupForLocale.hasDict(Dictionary.TYPE_MAIN, account)) {
315 dictTypeForLocale.add(Dictionary.TYPE_MAIN);
325 final Dictionary mainDict;
327 || !dictionaryGroupForLocale.hasDict(Dictionary.TYPE_MAIN, account)) {
330 mainDict = dictionaryGroupForLocale.getDict(Dictionary.TYPE_MAIN);
331 dictTypesToCleanupForLocale.remove(Dictionary.TYPE_MAIN);
339 // Create a new dictionary.
343 // Reuse the existing dictionary, and don't close it at the end
401 Log.w(TAG, "Expected a dictionary group for " + locale + " but none found");
404 final Dictionary mainDict =
410 // Dictionary facilitator has been reset for another locale.
425 Dictionary mainDictionary = null;
429 if (dictType.equals(Dictionary.TYPE_MAIN)) {
441 throw new RuntimeException("Unknown dictionary type: " + dictType);
470 final Dictionary mainDict = mDictionaryGroup.getDict(Dictionary.TYPE_MAIN);
478 final Dictionary mainDict = mDictionaryGroup.getDict(Dictionary.TYPE_MAIN);
546 dictionaryGroup.getSubDict(Dictionary.TYPE_USER_HISTORY);
559 // dictionary, then we must not downcase it before registering it. For example,
565 // If however the word is not in the dictionary, or exists as a lower-case word
571 // History dictionary in order to avoid suggesting them until the dictionary
574 final int lowerCaseFreqInMainDict = dictionaryGroup.hasDict(Dictionary.TYPE_MAIN,
576 dictionaryGroup.getDict(Dictionary.TYPE_MAIN).getFrequency(lowerCasedWord) :
577 Dictionary.NOT_A_PROBABILITY;
594 final ExpandableBinaryDictionary dictionary = mDictionaryGroup.getSubDict(dictName);
595 if (dictionary != null) {
596 dictionary.removeUnigramEntryDynamically(word);
606 removeWord(Dictionary.TYPE_USER_HISTORY, word);
625 new float[] { Dictionary.NOT_A_WEIGHT_OF_LANG_MODEL_VS_SPATIAL_MODEL };
627 final Dictionary dictionary = mDictionaryGroup.getDict(dictType);
628 if (null == dictionary) continue;
633 dictionary.getSuggestions(composedData, ngramContext,
668 final Dictionary dictionary = mDictionaryGroup.getDict(dictType);
672 if (null == dictionary) continue;
673 if (dictionary.isValidWord(word)) {
682 return Dictionary.NOT_A_PROBABILITY;
684 int maxFreq = Dictionary.NOT_A_PROBABILITY;
686 final Dictionary dictionary = mDictionaryGroup.getDict(dictType);
687 if (dictionary == null) continue;
688 final int tempFreq = dictionary.getFrequency(word);
697 final ExpandableBinaryDictionary dictionary = mDictionaryGroup.getSubDict(dictName);
698 if (dictionary == null) {
701 dictionary.clear();
707 return clearSubDictionary(Dictionary.TYPE_USER_HISTORY);
715 + "The dictionary is not being used for suggestion or cannot be dumped.");
725 final ExpandableBinaryDictionary dictionary = mDictionaryGroup.getSubDict(dictType);
726 if (dictionary == null) continue;
727 statsOfEnabledSubDicts.add(dictionary.getDictionaryStats());