diff options
author | 2012-09-10 14:19:41 +0900 | |
---|---|---|
committer | 2012-09-11 17:24:08 +0900 | |
commit | 8c06a468e0bffa5cedc7d782be4754da70d9a657 (patch) | |
tree | c9ad5592ce19f7e6e04f8d860eebad3933b93d34 /java/src/com/android/inputmethod/latin/Suggest.java | |
parent | 2935276110cf3588e2986b833cc78a7bab6253cc (diff) | |
download | latinime-8c06a468e0bffa5cedc7d782be4754da70d9a657.tar.gz latinime-8c06a468e0bffa5cedc7d782be4754da70d9a657.tar.xz latinime-8c06a468e0bffa5cedc7d782be4754da70d9a657.zip |
Stop auto-correcting non-whitelisted one-char strings
Bug: 7134017
Change-Id: I75cf474dedafda3e1683dd8f7740c13aafdcf5ab
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 |