diff options
author | 2013-10-04 23:26:18 +0900 | |
---|---|---|
committer | 2013-10-07 18:55:42 +0900 | |
commit | f3204eebb19f0f8fae9d6d81e7e2b430f29829a0 (patch) | |
tree | b109ea5081b5e06ab27e7293092e990f25c91c04 /java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java | |
parent | a8f4efd0132592c34ab87b6a3cf6ce1baa0f522d (diff) | |
download | latinime-f3204eebb19f0f8fae9d6d81e7e2b430f29829a0.tar.gz latinime-f3204eebb19f0f8fae9d6d81e7e2b430f29829a0.tar.xz latinime-f3204eebb19f0f8fae9d6d81e7e2b430f29829a0.zip |
Set the shortcut frequency correctly.
14 is the right value.
Bug: 11076722
Change-Id: I95d404b540f7fbe4932d1f8498cde23f1df0314f
Diffstat (limited to 'java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java b/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java index c79a4ff90..eb8650e6f 100644 --- a/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java @@ -261,10 +261,16 @@ abstract public class ExpandableBinaryDictionary extends Dictionary { /** * Adds a word unigram to the dictionary. Used for loading a dictionary. + * @param word The word to add. + * @param shortcutTarget A shortcut target for this word, or null if none. + * @param frequency The frequency for this unigram. + * @param shortcutFreq The frequency of the shortcut (0~15, with 15 = whitelist). Ignored + * if shortcutTarget is null. + * @param isNotAWord true if this is not a word, i.e. shortcut only. */ protected void addWord(final String word, final String shortcutTarget, - final int frequency, final boolean isNotAWord) { - mDictionaryWriter.addUnigramWord(word, shortcutTarget, frequency, isNotAWord); + final int frequency, final int shortcutFreq, final boolean isNotAWord) { + mDictionaryWriter.addUnigramWord(word, shortcutTarget, frequency, shortcutFreq, isNotAWord); } /** @@ -313,7 +319,7 @@ abstract public class ExpandableBinaryDictionary extends Dictionary { * Dynamically adds a word unigram to the dictionary. May overwrite an existing entry. */ protected void addWordDynamically(final String word, final String shortcutTarget, - final int frequency, final boolean isNotAWord) { + final int frequency, final int shortcutFreq, final boolean isNotAWord) { if (!mIsUpdatable) { Log.w(TAG, "addWordDynamically is called for non-updatable dictionary: " + mFilename); return; @@ -326,7 +332,8 @@ abstract public class ExpandableBinaryDictionary extends Dictionary { mBinaryDictionary.addUnigramWord(word, frequency); } else { // TODO: Remove. - mDictionaryWriter.addUnigramWord(word, shortcutTarget, frequency, isNotAWord); + mDictionaryWriter.addUnigramWord(word, shortcutTarget, frequency, shortcutFreq, + isNotAWord); } } }); |