diff options
author | 2012-07-11 18:43:26 +0900 | |
---|---|---|
committer | 2012-07-12 15:58:16 +0900 | |
commit | 24a63b5537ea4872ec10676d147ddccabda6a1f6 (patch) | |
tree | 25403060faeb05fda8746400884e16df3c10e722 /java/src/com/android/inputmethod/latin/Suggest.java | |
parent | f5b55cb70c9d6012e1aa2b201c4785530afab168 (diff) | |
download | latinime-24a63b5537ea4872ec10676d147ddccabda6a1f6.tar.gz latinime-24a63b5537ea4872ec10676d147ddccabda6a1f6.tar.xz latinime-24a63b5537ea4872ec10676d147ddccabda6a1f6.zip |
Simplification (A116)
Change-Id: I97cf92a7b0dabc251dd241b24978ea00d1e5f047
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Suggest.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/Suggest.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index 071daea38..7dbba9454 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -205,6 +205,12 @@ public class Suggest { final CharSequence whitelistedWord = mWhiteListDictionary.getWhitelistedWord(consideredWord); + if (whitelistedWord != null) { + // MAX_SCORE ensures this will be considered strong enough to be auto-corrected + suggestionsSet.add(new SuggestedWordInfo(whitelistedWord, + SuggestedWordInfo.MAX_SCORE, SuggestedWordInfo.KIND_WHITELIST, + Dictionary.TYPE_WHITELIST)); + } final boolean hasAutoCorrection; // TODO: using isCorrectionEnabled here is not very good. It's probably useless, because @@ -222,8 +228,6 @@ public class Suggest { // would always auto-correct to "Will" which is unwanted. Hence, no main dict => no // auto-correct. hasAutoCorrection = false; - } else if (null != whitelistedWord) { - hasAutoCorrection = true; } else if (suggestionsSet.isEmpty()) { hasAutoCorrection = false; } else if (AutoCorrection.suggestionExceedsAutoCorrectionThreshold(suggestionsSet.first(), @@ -233,12 +237,6 @@ public class Suggest { hasAutoCorrection = false; } - if (whitelistedWord != null) { - suggestionsSet.add(new SuggestedWordInfo(whitelistedWord, - SuggestedWordInfo.MAX_SCORE, SuggestedWordInfo.KIND_WHITELIST, - Dictionary.TYPE_WHITELIST)); - } - final ArrayList<SuggestedWordInfo> suggestionsContainer = new ArrayList<SuggestedWordInfo>(suggestionsSet); final int suggestionsCount = suggestionsContainer.size(); |