aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-02-25 16:44:43 +0900
committerJean Chalard <jchalard@google.com>2014-02-25 17:05:47 +0900
commit74224f2c5c1b54b459d885eb9695e10fb5f24ede (patch)
tree7bd2f56f5b517686bb510dcbe63dfdef0bc8f393 /java/src
parentef3a45643e950cdd934763c59963cee4089f93e1 (diff)
downloadlatinime-74224f2c5c1b54b459d885eb9695e10fb5f24ede.tar.gz
latinime-74224f2c5c1b54b459d885eb9695e10fb5f24ede.tar.xz
latinime-74224f2c5c1b54b459d885eb9695e10fb5f24ede.zip
[QRP2] Small refactor
Bug: 13170509 Change-Id: Ib9f10b8a137fc773ab0e5dc903e577038e29a9e2
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/Suggest.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index abf831a28..ac59f41e4 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -147,6 +147,8 @@ public final class Suggest {
}
}
+ final boolean isPrediction = !wordComposer.isComposingWord();
+
// We allow auto-correction if we have a whitelisted word, or if the word is not a valid
// word of more than 1 char, except if the first suggestion is the same as the typed string
// because in this case if it's strong enough to auto-correct that will mistakenly designate
@@ -165,7 +167,7 @@ public final class Suggest {
// same time, it feels wrong that the SuggestedWord object includes information about
// the current settings. It may also be useful to know, when the setting is off, whether
// the word *would* have been auto-corrected.
- if (!isCorrectionEnabled || !allowsToBeAutoCorrected || !wordComposer.isComposingWord()
+ if (!isCorrectionEnabled || !allowsToBeAutoCorrected || isPrediction
|| suggestionsSet.isEmpty() || wordComposer.hasDigits()
|| wordComposer.isMostlyCaps() || wordComposer.isResumed()
|| !mDictionaryFacilitator.hasMainDictionary()
@@ -227,8 +229,7 @@ public final class Suggest {
// rename the attribute or change the value.
!allowsToBeAutoCorrected /* typedWordValid */,
hasAutoCorrection, /* willAutoCorrect */
- false /* isObsoleteSuggestions */,
- !wordComposer.isComposingWord() /* isPrediction */, sequenceNumber));
+ false /* isObsoleteSuggestions */, isPrediction, sequenceNumber));
}
// Retrieves suggestions for the batch input