aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
authorSatoshi Kataoka <satok@google.com>2012-05-29 04:43:54 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-05-29 04:43:54 -0700
commit961e676b9a6b8282b1049715523aa520d3b6a6e5 (patch)
tree80b2e356c2fa93334c2311d210afbbf1cdbc508b /java/src/com/android/inputmethod/latin/LatinIME.java
parent9a3211802baf11e5749a080e4f451ef7b795220b (diff)
parentc88f61215c5b9ca6e0cc3f776e3b7da19eec9cae (diff)
downloadlatinime-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.java6
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;