aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2014-02-28 21:24:26 +0900
committerKeisuke Kuroyanagi <ksk@google.com>2014-02-28 21:24:26 +0900
commit23ae574a11a4edccf3bdc49122d37426d7157296 (patch)
tree12b0122a19be203b4cee1e9254345d3aeeaf3cfe /java/src
parent472e22a3265319fa360c11951fb4cd2ad06a4014 (diff)
downloadlatinime-23ae574a11a4edccf3bdc49122d37426d7157296.tar.gz
latinime-23ae574a11a4edccf3bdc49122d37426d7157296.tar.xz
latinime-23ae574a11a4edccf3bdc49122d37426d7157296.zip
Fix: wrong auto correction for whilelist and personalized words.
This happens when there are tailing single quotes. Bug: 13237314 Change-Id: I7fd2a20b25ac2217f9621d7f2510345bbd633c14
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/Suggest.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index e77cce0d4..f0e7d2f61 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -142,8 +142,8 @@ public final class Suggest {
whitelistedWord = firstSuggestion = null;
} else {
final SuggestedWordInfo firstSuggestedWordInfo = getTransformedSuggestedWordInfo(
- suggestionsSet.first(), mLocale, isAllUpperCase, isFirstCharCapitalized,
- trailingSingleQuotesCount);
+ suggestionsSet.first(), mLocale, isAllUpperCase, isFirstCharCapitalized,
+ trailingSingleQuotesCount);
firstSuggestion = firstSuggestedWordInfo.mWord;
if (SuggestedWordInfo.KIND_WHITELIST != firstSuggestedWordInfo.mKind) {
whitelistedWord = null;
@@ -161,10 +161,10 @@ public final class Suggest {
// TODO: stop relying on indices to find where is the auto-correction in the suggested
// words, and correct this test.
final boolean allowsToBeAutoCorrected = (null != whitelistedWord
- && !whitelistedWord.equals(consideredWord))
+ && !whitelistedWord.equals(typedWord))
|| (consideredWord.length() > 1 && !mDictionaryFacilitator.isValidWord(
consideredWord, wordComposer.isFirstCharCapitalized())
- && !consideredWord.equals(firstSuggestion));
+ && !typedWord.equals(firstSuggestion));
final boolean hasAutoCorrection;
// TODO: using isCorrectionEnabled here is not very good. It's probably useless, because