diff options
author | 2014-11-21 22:49:50 +0900 | |
---|---|---|
committer | 2014-11-26 18:43:22 +0900 | |
commit | 56577461d63ad3618598ceddfb9a73b797917061 (patch) | |
tree | 642c032ac1003d2447345fafa311adf30ef25381 /java/src/com/android/inputmethod/latin/utils | |
parent | e752aab70dc15c993a65d7db8314a72bb9e0f8b2 (diff) | |
download | latinime-56577461d63ad3618598ceddfb9a73b797917061.tar.gz latinime-56577461d63ad3618598ceddfb9a73b797917061.tar.xz latinime-56577461d63ad3618598ceddfb9a73b797917061.zip |
Allow whitelist changes when no close word
When there isn't a close word in another language of the
current multi-language set, we allow whitelist entries
to take force even if we are not confident in the current
language.
Bug: 18063142
Bug: 18130489
Bug: 18132240
Bug: 18136721
Bug: 18200415
Change-Id: I044674ba7b70aa86ab2a48d2e4d53a1c8007b62c
Diffstat (limited to 'java/src/com/android/inputmethod/latin/utils')
-rw-r--r-- | java/src/com/android/inputmethod/latin/utils/AutoCorrectionUtils.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/java/src/com/android/inputmethod/latin/utils/AutoCorrectionUtils.java b/java/src/com/android/inputmethod/latin/utils/AutoCorrectionUtils.java index 120cffbde..2fd257922 100644 --- a/java/src/com/android/inputmethod/latin/utils/AutoCorrectionUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/AutoCorrectionUtils.java @@ -29,9 +29,8 @@ public final class AutoCorrectionUtils { // Purely static class: can't instantiate. } - public static boolean suggestionExceedsAutoCorrectionThreshold( - final SuggestedWordInfo suggestion, final String consideredWord, - final float autoCorrectionThreshold) { + public static boolean suggestionExceedsThreshold(final SuggestedWordInfo suggestion, + final String consideredWord, final float threshold) { if (null != suggestion) { // Shortlist a whitelisted word if (suggestion.isKindOf(SuggestedWordInfo.KIND_WHITELIST)) { @@ -45,11 +44,11 @@ public final class AutoCorrectionUtils { if (DBG) { Log.d(TAG, "Normalized " + consideredWord + "," + suggestion + "," + autoCorrectionSuggestionScore + ", " + normalizedScore - + "(" + autoCorrectionThreshold + ")"); + + "(" + threshold + ")"); } - if (normalizedScore >= autoCorrectionThreshold) { + if (normalizedScore >= threshold) { if (DBG) { - Log.d(TAG, "Auto corrected by S-threshold."); + Log.d(TAG, "Exceeds threshold."); } return true; } |