diff options
author | 2012-03-09 12:51:15 +0900 | |
---|---|---|
committer | 2012-03-09 12:51:55 +0900 | |
commit | 94b20c90d86aa042c2f361597665045271956dec (patch) | |
tree | 1ea86c8fe2a93b5c013177b854f4460ca8744c98 /java/src/com/android/inputmethod/latin/Suggest.java | |
parent | dc5dfe37e06eb1d550d7aa5156cff226334d4e1e (diff) | |
download | latinime-94b20c90d86aa042c2f361597665045271956dec.tar.gz latinime-94b20c90d86aa042c2f361597665045271956dec.tar.xz latinime-94b20c90d86aa042c2f361597665045271956dec.zip |
Optimize and clean up (B2)
Stop parameters from escaping and don't do useless work and
simplify the code.
Yay.
Change-Id: I0dfc3e14b1cb50e0730f6d9c1d52b54516baa90e
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Suggest.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/Suggest.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index 889d50552..471b245d5 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -350,11 +350,16 @@ public class Suggest implements Dictionary.WordCallback { CharSequence whitelistedWord = capitalizeWord(mIsAllUpperCase, mIsFirstCharCapitalized, mWhiteListDictionary.getWhitelistedWord(consideredWordString)); - final CharSequence autoCorrection = - AutoCorrection.computeAutoCorrectionWord(mUnigramDictionaries, wordComposer, - mSuggestions, mScores, consideredWord, mAutoCorrectionThreshold, correctionMode, - whitelistedWord); - mHasAutoCorrection = (null != autoCorrection); + if (CORRECTION_FULL == correctionMode + || CORRECTION_FULL_BIGRAM == correctionMode) { + final CharSequence autoCorrection = + AutoCorrection.computeAutoCorrectionWord(mUnigramDictionaries, wordComposer, + mSuggestions, mScores, consideredWord, mAutoCorrectionThreshold, + whitelistedWord); + mHasAutoCorrection = (null != autoCorrection); + } else { + mHasAutoCorrection = false; + } if (whitelistedWord != null) { if (mTrailingSingleQuotesCount > 0) { |