aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index f7a77cae7..52b15cec8 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1793,6 +1793,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
// The whitelist should be case-insensitive, so it's not possible to be consistent with
// a boolean flag. Right now this is handled with a slight hack in
// WhitelistDictionary#shouldForciblyAutoCorrectFrom.
+ final int quotesCount = wordComposer.trailingSingleQuotesCount();
final boolean allowsToBeAutoCorrected = AutoCorrection.allowsToBeAutoCorrected(
mSuggest.getUnigramDictionaries(),
// If the typed string ends with a single quote, for dictionary lookup purposes
@@ -1800,8 +1801,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
// typed string in the dictionary (to avoid autocorrecting from an existing
// word, so for consistency this lookup should be made WITHOUT the trailing
// single quote.
- wordComposer.isLastCharASingleQuote()
- ? typedWord.subSequence(0, typedWord.length() - 1) : typedWord,
+ quotesCount > 0
+ ? typedWord.subSequence(0, typedWord.length() - quotesCount) : typedWord,
preferCapitalization());
if (mCorrectionMode == Suggest.CORRECTION_FULL
|| mCorrectionMode == Suggest.CORRECTION_FULL_BIGRAM) {