diff options
author | 2012-06-14 12:39:14 +0900 | |
---|---|---|
committer | 2012-06-14 15:15:08 +0900 | |
commit | 68c650fb2a3b26d4000e849f96f0664598c95470 (patch) | |
tree | aede9d2d3293ad995355ae60ccf1b53991f18d44 /java/src | |
parent | 62b1e67215cef632b9447839ff5b1bd268dc3924 (diff) | |
download | latinime-68c650fb2a3b26d4000e849f96f0664598c95470.tar.gz latinime-68c650fb2a3b26d4000e849f96f0664598c95470.tar.xz latinime-68c650fb2a3b26d4000e849f96f0664598c95470.zip |
Do not add profanity to user history bigram dicitonary
Change-Id: I864c4206e3e6cde4d6ed687a9759e98901e16b9a
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; |