aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/Suggest.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-08-10 03:21:11 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-08-10 03:21:11 -0700
commit225659a7ec02f4a8f30b09d6755f174ea736802a (patch)
tree1e005894a36605a83f6a1b6980d25abf008ef0da /java/src/com/android/inputmethod/latin/Suggest.java
parente0b0813f5e4c7ab5aeefa6c56aef189766fe8047 (diff)
parentb5cb4447cfbc7d397f4da7d3753431bc97ee445e (diff)
downloadlatinime-225659a7ec02f4a8f30b09d6755f174ea736802a.tar.gz
latinime-225659a7ec02f4a8f30b09d6755f174ea736802a.tar.xz
latinime-225659a7ec02f4a8f30b09d6755f174ea736802a.zip
am b5cb4447: am 58040e7d: Merge "Optimization & Simplification" into jb-mr1-dev
* commit 'b5cb4447cfbc7d397f4da7d3753431bc97ee445e': Optimization & Simplification
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Suggest.java')
-rw-r--r--java/src/com/android/inputmethod/latin/Suggest.java18
1 files changed, 10 insertions, 8 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index a65d36adb..ce27ef4af 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -208,14 +208,6 @@ public class Suggest {
wordComposerForLookup, prevWordForBigram, proximityInfo));
}
- // TODO: Change this scheme - a boolean is not enough. A whitelisted word may be "valid"
- // but still autocorrected from - in the case the whitelist only capitalizes the word.
- // 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 boolean allowsToBeAutoCorrected = AutoCorrection.isWhitelistedOrNotAWord(
- mDictionaries, consideredWord, wordComposer.isFirstCharCapitalized());
-
final CharSequence whitelistedWord =
mWhiteListDictionary.getWhitelistedWord(consideredWord);
if (whitelistedWord != null) {
@@ -225,6 +217,16 @@ public class Suggest {
Dictionary.TYPE_WHITELIST));
}
+ // TODO: Change this scheme - a boolean is not enough. A whitelisted word may be "valid"
+ // but still autocorrected from - in the case the whitelist only capitalizes the word.
+ // 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 boolean allowsToBeAutoCorrected = (null != whitelistedWord
+ && !whitelistedWord.equals(consideredWord))
+ || AutoCorrection.isNotAWord(mDictionaries, consideredWord,
+ wordComposer.isFirstCharCapitalized());
+
final boolean hasAutoCorrection;
// TODO: using isCorrectionEnabled here is not very good. It's probably useless, because
// any attempt to do auto-correction is already shielded with a test for this flag; at the