aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-06-28 16:30:58 +0900
committerJean Chalard <jchalard@google.com>2012-06-29 15:12:51 +0900
commitd426941ee8fd3f0bed5b26cbcf3780169054574d (patch)
treed4ca383d697b7d4740b7ca6a674eb28fa5f87587 /java/src
parent9701b360d9a44a06a20554e8998007a614b1622d (diff)
downloadlatinime-d426941ee8fd3f0bed5b26cbcf3780169054574d.tar.gz
latinime-d426941ee8fd3f0bed5b26cbcf3780169054574d.tar.xz
latinime-d426941ee8fd3f0bed5b26cbcf3780169054574d.zip
Fix a theoretical bug (A12)
If a word is a dictionary word but still has no suggestion, this method should return true. In the practice, it makes no difference since a word without suggestion won't be changed anyway. Change-Id: Ib1f5ef254b7da7e5cedb2f973529ad431beb93f9
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/AutoCorrection.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/AutoCorrection.java b/java/src/com/android/inputmethod/latin/AutoCorrection.java
index 5c7bc13a3..3699938c2 100644
--- a/java/src/com/android/inputmethod/latin/AutoCorrection.java
+++ b/java/src/com/android/inputmethod/latin/AutoCorrection.java
@@ -38,8 +38,7 @@ public class AutoCorrection {
final CharSequence whitelistedWord) {
if (hasAutoCorrectionForWhitelistedWord(whitelistedWord)) {
return whitelistedWord;
- } else if (shouldAutoCorrectToSelf(
- dictionaries, wordComposer, suggestion, consideredWord)) {
+ } else if (shouldAutoCorrectToSelf(dictionaries, wordComposer, consideredWord)) {
return consideredWord;
} else if (hasAutoCorrectionForBinaryDictionary(wordComposer, suggestion,
consideredWord, autoCorrectionThreshold)) {
@@ -111,10 +110,9 @@ public class AutoCorrection {
private static boolean shouldAutoCorrectToSelf(
final ConcurrentHashMap<String, Dictionary> dictionaries,
- final WordComposer wordComposer, final SuggestedWordInfo suggestion,
- final CharSequence consideredWord) {
+ final WordComposer wordComposer, final CharSequence consideredWord) {
if (TextUtils.isEmpty(consideredWord)) return false;
- return wordComposer.size() > 1 && null != suggestion
+ return wordComposer.size() > 1
&& !allowsToBeAutoCorrected(dictionaries, consideredWord, false);
}