aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/UserBinaryDictionary.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-10-07 03:02:06 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-07 03:02:06 -0700
commitd44b249043754e5e0561d53ee337a250be14d492 (patch)
treeabe50cb09bc81a7b4585c3ad2877b3e40df01270 /java/src/com/android/inputmethod/latin/UserBinaryDictionary.java
parenteafff65bbe2583b5f97b8e80312ecd6bc5c6eac5 (diff)
parenta6047aae941e0723367fa9c52157271eb405b6fb (diff)
downloadlatinime-d44b249043754e5e0561d53ee337a250be14d492.tar.gz
latinime-d44b249043754e5e0561d53ee337a250be14d492.tar.xz
latinime-d44b249043754e5e0561d53ee337a250be14d492.zip
am a6047aae: Merge "Set the shortcut frequency correctly."
* commit 'a6047aae941e0723367fa9c52157271eb405b6fb': Set the shortcut frequency correctly.
Diffstat (limited to 'java/src/com/android/inputmethod/latin/UserBinaryDictionary.java')
-rw-r--r--java/src/com/android/inputmethod/latin/UserBinaryDictionary.java9
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();
}