diff options
author | 2012-05-29 04:49:33 -0700 | |
---|---|---|
committer | 2012-05-29 04:49:33 -0700 | |
commit | c5d4362b59e98c07846e90cd2514ab9802bdfbad (patch) | |
tree | df7f3ad1075606f2fc11cd474962cac5b468fdca /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | 2033d9880e88c0e9c8e4cfd3aeea063afbce46e5 (diff) | |
parent | 408fa1ac48a3eb6f378274d5dd0e490da0f453ae (diff) | |
download | latinime-c5d4362b59e98c07846e90cd2514ab9802bdfbad.tar.gz latinime-c5d4362b59e98c07846e90cd2514ab9802bdfbad.tar.xz latinime-c5d4362b59e98c07846e90cd2514ab9802bdfbad.zip |
am 408fa1ac: am 961e676b: Merge "Set level 1 as the initial value of the valid words" into jb-dev
* commit '408fa1ac48a3eb6f378274d5dd0e490da0f453ae':
Set level 1 as the initial value of the valid words
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 f38b4141a..bd9a0c1d4 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -2104,8 +2104,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; |