diff options
author | 2015-02-25 21:25:12 +0000 | |
---|---|---|
committer | 2015-02-25 21:25:12 +0000 | |
commit | 6e8c45a4da08a3c9a9d4c88f075ffbe8987e054b (patch) | |
tree | 83cbdd7f8579ae3fcc86ce21af79a8c31cb5388b /java | |
parent | 2d91e5419f49fa502b5a09e449e30f730b81538e (diff) | |
parent | ed378c78a15757c7386d84c6cd7470d56ed00c76 (diff) | |
download | latinime-6e8c45a4da08a3c9a9d4c88f075ffbe8987e054b.tar.gz latinime-6e8c45a4da08a3c9a9d4c88f075ffbe8987e054b.tar.xz latinime-6e8c45a4da08a3c9a9d4c88f075ffbe8987e054b.zip |
am ed378c78: Auto-correct without whitelist in Delight3.
* commit 'ed378c78a15757c7386d84c6cd7470d56ed00c76':
Auto-correct without whitelist in Delight3.
Diffstat (limited to 'java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/Suggest.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index 428956a7b..832fcbcb0 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -18,6 +18,8 @@ package com.android.inputmethod.latin; import android.text.TextUtils; +import static com.android.inputmethod.latin.define.DecoderSpecificConstants.SHOULD_AUTO_CORRECT_USING_NON_WHITE_LISTED_SUGGESTION; + import com.android.inputmethod.keyboard.KeyboardLayout; import com.android.inputmethod.keyboard.ProximityInfo; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; @@ -236,10 +238,11 @@ public final class Suggest { } final boolean resultsArePredictions = !wordComposer.isComposingWord(); - // We allow auto-correction if we have a whitelisted word, or if the word had more than - // one char and was not suggested. - final boolean allowsToBeAutoCorrected = (null != whitelistedWord) - || (consideredWord.length() > 1 && (null == sourceDictionaryOfRemovedWord)); + // We allow auto-correction if whitelisting is not required or the word is whitelisted, + // or if the word had more than one char and was not suggested. + final boolean allowsToBeAutoCorrected = + (SHOULD_AUTO_CORRECT_USING_NON_WHITE_LISTED_SUGGESTION || whitelistedWord != null) + || (consideredWord.length() > 1 && (sourceDictionaryOfRemovedWord == null)); final boolean hasAutoCorrection; // If correction is not enabled, we never auto-correct. This is for example for when |