aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/Suggest.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-06-28 16:54:53 +0900
committerJean Chalard <jchalard@google.com>2012-06-29 15:12:51 +0900
commit074c90af98487f94bac26d9463020e883b26f358 (patch)
tree9097bc0351859ecbd8ebe0612e2bf6996007c87a /java/src/com/android/inputmethod/latin/Suggest.java
parent1333579b4b4f392c73409b9a3fbfb428a0f8a9ed (diff)
downloadlatinime-074c90af98487f94bac26d9463020e883b26f358.tar.gz
latinime-074c90af98487f94bac26d9463020e883b26f358.tar.xz
latinime-074c90af98487f94bac26d9463020e883b26f358.zip
Inline a method (A14)
The new code is worse than the old one, but this is a necessary step to make things prettier. Change-Id: If6e8a139bb85e6920c749743c78792a22a8acb45
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Suggest.java')
-rw-r--r--java/src/com/android/inputmethod/latin/Suggest.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index 2d388e180..195c19b4d 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -230,10 +230,17 @@ public class Suggest {
if (isCorrectionEnabled) {
final SuggestedWordInfo bestSuggestion = suggestionsSet.isEmpty()
? null : suggestionsSet.first();
- final CharSequence autoCorrection =
- AutoCorrection.computeAutoCorrectionWord(mDictionaries, wordComposer,
- bestSuggestion, consideredWord, mAutoCorrectionThreshold,
- whitelistedWord);
+ final CharSequence autoCorrection;
+ if (AutoCorrection.hasAutoCorrectionForWhitelistedWord(whitelistedWord)) {
+ autoCorrection = whitelistedWord;
+ } else if (AutoCorrection.shouldAutoCorrectToSelf(mDictionaries, consideredWord)) {
+ autoCorrection = consideredWord;
+ } else if (AutoCorrection.hasAutoCorrectionForBinaryDictionary(bestSuggestion,
+ consideredWord, mAutoCorrectionThreshold)) {
+ autoCorrection = bestSuggestion.mWord;
+ } else {
+ autoCorrection = null;
+ }
hasAutoCorrection = (null != autoCorrection);
} else {
hasAutoCorrection = false;