aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorSatoshi Kataoka <satok@google.com>2012-06-14 10:33:47 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-06-14 10:33:47 -0700
commitd2f210dbe2c3562151f85ec25c45858462fd08ed (patch)
treeede37344decfa6053fa8e97f7c7a995188589f0f /java/src
parentc380959f48c8f56f31a04c2fb34eb50715e30fcf (diff)
parentd9c702d2ff017452f0264f2be12b6bffd6204e4a (diff)
downloadlatinime-d2f210dbe2c3562151f85ec25c45858462fd08ed.tar.gz
latinime-d2f210dbe2c3562151f85ec25c45858462fd08ed.tar.xz
latinime-d2f210dbe2c3562151f85ec25c45858462fd08ed.zip
am d9c702d2: am 5caaf1b9: Merge "Do not add profanity to user history bigram dicitonary" into jb-dev
* commit 'd9c702d2ff017452f0264f2be12b6bffd6204e4a': Do not add profanity to user history bigram dicitonary
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java5
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 00d4dfe93..3456ce945 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1981,10 +1981,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;