diff options
author | 2012-06-28 18:28:10 +0900 | |
---|---|---|
committer | 2012-06-29 17:00:56 +0900 | |
commit | 9e0af5773649140b5cf3f70c6def207c5a06627c (patch) | |
tree | bd33af892b278454a4b650ba704472d33f63a955 | |
parent | 7a94cbd2a488d2ff3a4c0b6a4e846d9380600d2e (diff) | |
download | latinime-9e0af5773649140b5cf3f70c6def207c5a06627c.tar.gz latinime-9e0af5773649140b5cf3f70c6def207c5a06627c.tar.xz latinime-9e0af5773649140b5cf3f70c6def207c5a06627c.zip |
Optimization (A26)
Change-Id: I1d7790289635729645995fb8c38868259ab1b3be
-rw-r--r-- | java/src/com/android/inputmethod/latin/Suggest.java | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index 2bbe82735..69f37dd94 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -238,7 +238,8 @@ public class Suggest { hasAutoCorrection = false; } else if (AutoCorrection.suggestionExceedsAutoCorrectionThreshold(suggestionsSet.first(), consideredWord, mAutoCorrectionThreshold)) { - hasAutoCorrection = true; + hasAutoCorrection = !shouldBlockAutoCorrectionBySafetyNet(typedWord, + suggestionsSet.first().mWord); } else { hasAutoCorrection = false; } @@ -299,14 +300,6 @@ public class Suggest { // Don't auto-correct words with multiple capital letter autoCorrectionAvailable &= !wordComposer.isMostlyCaps(); autoCorrectionAvailable &= !wordComposer.isResumed(); - // TODO: this safety net check should be done right after we decide that the suggestion - // exceeds the auto-correction threshold. However as long as the |= !allowsToBeAutoCorrected - // line is there it can't be done safely in a logical manner. - if (allowsToBeAutoCorrected && suggestionsList.size() > 1 && mAutoCorrectionThreshold > 0 - && Suggest.shouldBlockAutoCorrectionBySafetyNet(typedWord, - suggestionsList.get(1).mWord)) { - autoCorrectionAvailable = false; - } return new SuggestedWords(suggestionsList, // TODO: this first argument is lying. If this is a whitelisted word which is an // actual word, it says typedWordValid = false, which looks wrong. We should either |