Remove last vestiges of contextual+personal dictionary.
Change-Id: I20746381583ee8a4d7d42b1243f5c7ba45529e5emain
parent
daa3ad8605
commit
0d3f01f301
|
@ -49,8 +49,7 @@ public abstract class Dictionary {
|
||||||
|
|
||||||
// Spawned by resuming suggestions. Comes from a span that was in the TextView.
|
// Spawned by resuming suggestions. Comes from a span that was in the TextView.
|
||||||
public static final String TYPE_RESUMED = "resumed";
|
public static final String TYPE_RESUMED = "resumed";
|
||||||
public static final PhonyDictionary DICTIONARY_RESUMED =
|
public static final PhonyDictionary DICTIONARY_RESUMED = new PhonyDictionary(TYPE_RESUMED);
|
||||||
new PhonyDictionary(TYPE_RESUMED);
|
|
||||||
|
|
||||||
// The following types of dictionary have actual functional instances. We don't need final
|
// The following types of dictionary have actual functional instances. We don't need final
|
||||||
// phony dictionary instances for them.
|
// phony dictionary instances for them.
|
||||||
|
@ -60,10 +59,6 @@ public abstract class Dictionary {
|
||||||
public static final String TYPE_USER = "user";
|
public static final String TYPE_USER = "user";
|
||||||
// User history dictionary internal to LatinIME.
|
// User history dictionary internal to LatinIME.
|
||||||
public static final String TYPE_USER_HISTORY = "history";
|
public static final String TYPE_USER_HISTORY = "history";
|
||||||
// Personalization dictionary.
|
|
||||||
public static final String TYPE_PERSONALIZATION = "personalization";
|
|
||||||
// Contextual dictionary.
|
|
||||||
public static final String TYPE_CONTEXTUAL = "contextual";
|
|
||||||
public final String mDictType;
|
public final String mDictType;
|
||||||
// The locale for this dictionary. May be null if unknown (phony dictionary for example).
|
// The locale for this dictionary. May be null if unknown (phony dictionary for example).
|
||||||
public final Locale mLocale;
|
public final Locale mLocale;
|
||||||
|
@ -76,9 +71,7 @@ public abstract class Dictionary {
|
||||||
TYPE_USER_TYPED,
|
TYPE_USER_TYPED,
|
||||||
TYPE_USER,
|
TYPE_USER,
|
||||||
TYPE_CONTACTS,
|
TYPE_CONTACTS,
|
||||||
TYPE_USER_HISTORY,
|
TYPE_USER_HISTORY));
|
||||||
TYPE_PERSONALIZATION,
|
|
||||||
TYPE_CONTEXTUAL));
|
|
||||||
|
|
||||||
public Dictionary(final String dictType, final Locale locale) {
|
public Dictionary(final String dictType, final Locale locale) {
|
||||||
mDictType = dictType;
|
mDictType = dictType;
|
||||||
|
|
|
@ -115,8 +115,6 @@ public interface DictionaryFacilitator {
|
||||||
|
|
||||||
boolean hasAtLeastOneUninitializedMainDictionary();
|
boolean hasAtLeastOneUninitializedMainDictionary();
|
||||||
|
|
||||||
boolean hasPersonalizationDictionary();
|
|
||||||
|
|
||||||
void waitForLoadingMainDictionaries(final long timeout, final TimeUnit unit)
|
void waitForLoadingMainDictionaries(final long timeout, final TimeUnit unit)
|
||||||
throws InterruptedException;
|
throws InterruptedException;
|
||||||
|
|
||||||
|
|
|
@ -392,8 +392,6 @@ public class DictionaryFacilitatorImpl implements DictionaryFacilitator {
|
||||||
}
|
}
|
||||||
if (usePersonalizedDicts) {
|
if (usePersonalizedDicts) {
|
||||||
subDictTypesToUse.add(Dictionary.TYPE_USER_HISTORY);
|
subDictTypesToUse.add(Dictionary.TYPE_USER_HISTORY);
|
||||||
subDictTypesToUse.add(Dictionary.TYPE_PERSONALIZATION);
|
|
||||||
subDictTypesToUse.add(Dictionary.TYPE_CONTEXTUAL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gather all dictionaries. We'll remove them from the list to clean up later.
|
// Gather all dictionaries. We'll remove them from the list to clean up later.
|
||||||
|
@ -600,16 +598,6 @@ public class DictionaryFacilitatorImpl implements DictionaryFacilitator {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasPersonalizationDictionary() {
|
|
||||||
final DictionaryGroup[] dictionaryGroups = mDictionaryGroups;
|
|
||||||
for (final DictionaryGroup dictionaryGroup : dictionaryGroups) {
|
|
||||||
if (dictionaryGroup.hasDict(Dictionary.TYPE_PERSONALIZATION, null /* account */)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void waitForLoadingMainDictionaries(final long timeout, final TimeUnit unit)
|
public void waitForLoadingMainDictionaries(final long timeout, final TimeUnit unit)
|
||||||
throws InterruptedException {
|
throws InterruptedException {
|
||||||
mLatchForWaitingLoadingMainDictionaries.await(timeout, unit);
|
mLatchForWaitingLoadingMainDictionaries.await(timeout, unit);
|
||||||
|
@ -708,8 +696,6 @@ public class DictionaryFacilitatorImpl implements DictionaryFacilitator {
|
||||||
|
|
||||||
public void removeWordFromPersonalizedDicts(final String word) {
|
public void removeWordFromPersonalizedDicts(final String word) {
|
||||||
removeWord(Dictionary.TYPE_USER_HISTORY, word);
|
removeWord(Dictionary.TYPE_USER_HISTORY, word);
|
||||||
removeWord(Dictionary.TYPE_PERSONALIZATION, word);
|
|
||||||
removeWord(Dictionary.TYPE_CONTEXTUAL, word);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Revise the way to fusion suggestion results.
|
// TODO: Revise the way to fusion suggestion results.
|
||||||
|
@ -814,10 +800,6 @@ public class DictionaryFacilitatorImpl implements DictionaryFacilitator {
|
||||||
clearSubDictionary(Dictionary.TYPE_USER_HISTORY);
|
clearSubDictionary(Dictionary.TYPE_USER_HISTORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearContextualDictionary() {
|
|
||||||
clearSubDictionary(Dictionary.TYPE_CONTEXTUAL);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void dumpDictionaryForDebug(final String dictName) {
|
public void dumpDictionaryForDebug(final String dictName) {
|
||||||
final DictionaryGroup[] dictionaryGroups = mDictionaryGroups;
|
final DictionaryGroup[] dictionaryGroups = mDictionaryGroups;
|
||||||
for (final DictionaryGroup dictionaryGroup : dictionaryGroups) {
|
for (final DictionaryGroup dictionaryGroup : dictionaryGroups) {
|
||||||
|
|
Loading…
Reference in New Issue