diff options
author | 2012-05-29 04:43:54 -0700 | |
---|---|---|
committer | 2012-05-29 04:43:54 -0700 | |
commit | 961e676b9a6b8282b1049715523aa520d3b6a6e5 (patch) | |
tree | 80b2e356c2fa93334c2311d210afbbf1cdbc508b /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | 9a3211802baf11e5749a080e4f451ef7b795220b (diff) | |
parent | c88f61215c5b9ca6e0cc3f776e3b7da19eec9cae (diff) | |
download | latinime-961e676b9a6b8282b1049715523aa520d3b6a6e5.tar.gz latinime-961e676b9a6b8282b1049715523aa520d3b6a6e5.tar.xz latinime-961e676b9a6b8282b1049715523aa520d3b6a6e5.zip |
Merge "Set level 1 as the initial value of the valid words" into jb-dev
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 52088812d..38549436b 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -2093,8 +2093,12 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } else { secondWord = suggestion.toString(); } + // We demote unrecognized word and words with 0-frequency (assuming they would be + // profanity etc.) by specifying them as "invalid". + final int maxFreq = AutoCorrection.getMaxFrequency( + mSuggest.getUnigramDictionaries(), suggestion); mUserHistoryDictionary.addToUserHistory(null == prevWord ? null : prevWord.toString(), - secondWord); + secondWord, maxFreq > 0); return prevWord; } return null; |