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/UserBinaryDictionary.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/UserBinaryDictionary.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/UserBinaryDictionary.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/UserBinaryDictionary.java b/java/src/com/android/inputmethod/latin/UserBinaryDictionary.java index 864a17375..15b3d8d02 100644 --- a/java/src/com/android/inputmethod/latin/UserBinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/UserBinaryDictionary.java @@ -47,6 +47,9 @@ public class UserBinaryDictionary extends ExpandableBinaryDictionary { private static final String USER_DICTIONARY_ALL_LANGUAGES = ""; private static final int HISTORICAL_DEFAULT_USER_DICTIONARY_FREQUENCY = 250; private static final int LATINIME_DEFAULT_USER_DICTIONARY_FREQUENCY = 160; + // Shortcut frequency is 0~15, with 15 = whitelist. We don't want user dictionary entries + // to auto-correct, so we set this to the highest frequency that won't, i.e. 14. + private static final int USER_DICT_SHORTCUT_FREQUENCY = 14; // TODO: use Words.SHORTCUT when we target JellyBean or above final static String SHORTCUT = "shortcut"; @@ -243,10 +246,12 @@ public class UserBinaryDictionary extends ExpandableBinaryDictionary { final int adjustedFrequency = scaleFrequencyFromDefaultToLatinIme(frequency); // Safeguard against adding really long words. if (word.length() < MAX_WORD_LENGTH) { - super.addWord(word, null, adjustedFrequency, false /* isNotAWord */); + super.addWord(word, null, adjustedFrequency, 0 /* shortcutFreq */, + false /* isNotAWord */); } if (null != shortcut && shortcut.length() < MAX_WORD_LENGTH) { - super.addWord(shortcut, word, adjustedFrequency, true /* isNotAWord */); + super.addWord(shortcut, word, adjustedFrequency, USER_DICT_SHORTCUT_FREQUENCY, + true /* isNotAWord */); } cursor.moveToNext(); } |