diff options
author | 2011-11-29 14:15:41 +0900 | |
---|---|---|
committer | 2011-11-29 15:16:28 +0900 | |
commit | 117fc18ed46496c81596f8207bba30a09c7317d1 (patch) | |
tree | 97d7e0954012a10f3ce0d339e7d6103b0a039ddc /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | e2d00ab470232c8ae75b1900dd7e63fd2dbd3e2d (diff) | |
download | latinime-117fc18ed46496c81596f8207bba30a09c7317d1.tar.gz latinime-117fc18ed46496c81596f8207bba30a09c7317d1.tar.xz latinime-117fc18ed46496c81596f8207bba30a09c7317d1.zip |
Keep count of the trailing single quotes for suggestions
Bug: 5665809
Change-Id: I4d9100dbe980861ccb55c78464524be670cac1f7
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 5 |
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) { |