diff options
author | 2011-11-29 00:48:29 -0800 | |
---|---|---|
committer | 2011-11-29 00:48:29 -0800 | |
commit | e30ceed86bd0bf12c86c8bf56d06c6f423cd8876 (patch) | |
tree | 97d7e0954012a10f3ce0d339e7d6103b0a039ddc /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | 0d8dde1185ab495eb3dee091f7a6ba2e131e7f54 (diff) | |
parent | 117fc18ed46496c81596f8207bba30a09c7317d1 (diff) | |
download | latinime-e30ceed86bd0bf12c86c8bf56d06c6f423cd8876.tar.gz latinime-e30ceed86bd0bf12c86c8bf56d06c6f423cd8876.tar.xz latinime-e30ceed86bd0bf12c86c8bf56d06c6f423cd8876.zip |
am 117fc18e: Keep count of the trailing single quotes for suggestions
* commit '117fc18ed46496c81596f8207bba30a09c7317d1':
Keep count of the trailing single quotes for suggestions
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) { |