diff options
author | 2012-09-12 13:17:38 -0700 | |
---|---|---|
committer | 2012-09-12 13:17:38 -0700 | |
commit | e505c90b11c6e482d8853690a4eb1c5b5a86a9c4 (patch) | |
tree | 793e04672c28d8aaf84905dd8192088f5a53e554 /java/src/com/android/inputmethod/latin/Suggest.java | |
parent | a0c9c1b6c37307ef0ef3920228fbe5ff92e34856 (diff) | |
parent | 28892e6e6569440530e6cbf7caf882f75dc3acac (diff) | |
download | latinime-e505c90b11c6e482d8853690a4eb1c5b5a86a9c4.tar.gz latinime-e505c90b11c6e482d8853690a4eb1c5b5a86a9c4.tar.xz latinime-e505c90b11c6e482d8853690a4eb1c5b5a86a9c4.zip |
am 28892e6e: am b0c693d0: Merge "Stop auto-correcting non-whitelisted one-char strings" into jb-mr1-dev
* commit '28892e6e6569440530e6cbf7caf882f75dc3acac':
Stop auto-correcting non-whitelisted one-char strings
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Suggest.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/Suggest.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index 51ed09604..f922bc9e0 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -214,10 +214,12 @@ public class Suggest { whitelistedWord = suggestionsSet.first().mWord; } + // The word can be auto-corrected if it has a whitelist entry that is not itself, + // or if it's a 2+ characters non-word (i.e. it's not in the dictionary). final boolean allowsToBeAutoCorrected = (null != whitelistedWord && !whitelistedWord.equals(consideredWord)) - || AutoCorrection.isNotAWord(mDictionaries, consideredWord, - wordComposer.isFirstCharCapitalized()); + || (consideredWord.length() > 1 && !AutoCorrection.isInTheDictionary(mDictionaries, + consideredWord, wordComposer.isFirstCharCapitalized())); final boolean hasAutoCorrection; // TODO: using isCorrectionEnabled here is not very good. It's probably useless, because |