diff options
author | 2014-04-25 04:30:38 +0000 | |
---|---|---|
committer | 2014-04-25 04:30:39 +0000 | |
commit | 3d2a9af20ac78ed29144345f0e95c3baf6d9ed6f (patch) | |
tree | 356846cbd897b9cc5db0883950ecabac2794c6dc /java/src/com/android/inputmethod/latin/personalization/DecayingExpandableBinaryDictionaryBase.java | |
parent | a933776bf1d4cc7ad86946e05bfa2056c18772b0 (diff) | |
parent | 67c0ed8f8c14f79e61cbd16f841b1b1f3a7466d7 (diff) | |
download | latinime-3d2a9af20ac78ed29144345f0e95c3baf6d9ed6f.tar.gz latinime-3d2a9af20ac78ed29144345f0e95c3baf6d9ed6f.tar.xz latinime-3d2a9af20ac78ed29144345f0e95c3baf6d9ed6f.zip |
Merge "Handle user history dictionary as an ExpandableBinaryDictionary."
Diffstat (limited to 'java/src/com/android/inputmethod/latin/personalization/DecayingExpandableBinaryDictionaryBase.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/personalization/DecayingExpandableBinaryDictionaryBase.java | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/java/src/com/android/inputmethod/latin/personalization/DecayingExpandableBinaryDictionaryBase.java b/java/src/com/android/inputmethod/latin/personalization/DecayingExpandableBinaryDictionaryBase.java index 46862c1c0..35b4ccd40 100644 --- a/java/src/com/android/inputmethod/latin/personalization/DecayingExpandableBinaryDictionaryBase.java +++ b/java/src/com/android/inputmethod/latin/personalization/DecayingExpandableBinaryDictionaryBase.java @@ -65,12 +65,8 @@ public abstract class DecayingExpandableBinaryDictionaryBase extends ExpandableB dumpAllWordsForDebug(); } // Flush pending writes. - flush(); - super.close(); - } - - public void flush() { asyncFlushBinaryDictionary(); + super.close(); } @Override @@ -103,33 +99,6 @@ public abstract class DecayingExpandableBinaryDictionaryBase extends ExpandableB addMultipleDictionaryEntriesDynamically(languageModelParams, callback); } - /** - * Pair will be added to the decaying dictionary. - * - * The first word may be null. That means we don't know the context, in other words, - * it's only a unigram. The first word may also be an empty string : this means start - * context, as in beginning of a sentence for example. - * The second word may not be null (a NullPointerException would be thrown). - */ - public void addToDictionary(final String word0, final String word1, final boolean isValid, - final int timestamp) { - if (word1.length() >= Constants.DICTIONARY_MAX_WORD_LENGTH || - (word0 != null && word0.length() >= Constants.DICTIONARY_MAX_WORD_LENGTH)) { - return; - } - final int frequency = isValid ? - FREQUENCY_FOR_WORDS_IN_DICTS : FREQUENCY_FOR_WORDS_NOT_IN_DICTS; - addWordDynamically(word1, frequency, null /* shortcutTarget */, 0 /* shortcutFreq */, - false /* isNotAWord */, false /* isBlacklisted */, timestamp); - // Do not insert a word as a bigram of itself - if (word1.equals(word0)) { - return; - } - if (null != word0) { - addBigramDynamically(word0, word1, frequency, timestamp); - } - } - @Override protected void loadInitialContentsLocked() { // No initial contents. |