diff options
author | 2012-06-14 00:33:59 -0700 | |
---|---|---|
committer | 2012-06-14 00:33:59 -0700 | |
commit | d9c702d2ff017452f0264f2be12b6bffd6204e4a (patch) | |
tree | e6e821e6a81b5dcde8084fa05e3ecf46efc090e3 /java/src | |
parent | bbf188075d5e14626c0609f4c3ee6031f6c6d5a6 (diff) | |
parent | 5caaf1b9e9720d0d3d461623a34dfe797a4095d0 (diff) | |
download | latinime-d9c702d2ff017452f0264f2be12b6bffd6204e4a.tar.gz latinime-d9c702d2ff017452f0264f2be12b6bffd6204e4a.tar.xz latinime-d9c702d2ff017452f0264f2be12b6bffd6204e4a.zip |
am 5caaf1b9: Merge "Do not add profanity to user history bigram dicitonary" into jb-dev
* commit '5caaf1b9e9720d0d3d461623a34dfe797a4095d0':
Do not add profanity to user history bigram dicitonary
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index bfdc1e3c5..1f2982aed 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -2089,10 +2089,11 @@ 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". + // We demote unrecognized words (frequency < 0, below) by specifying them as "invalid". + // We don't add words with 0-frequency (assuming they would be profanity etc.). final int maxFreq = AutoCorrection.getMaxFrequency( mSuggest.getUnigramDictionaries(), suggestion); + if (maxFreq == 0) return null; mUserHistoryDictionary.addToUserHistory(null == prevWord ? null : prevWord.toString(), secondWord, maxFreq > 0); return prevWord; |