aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-07-10 02:24:36 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-07-10 02:24:36 -0700
commit50d1b7902f8a8115a542a27b5f1141d6d9193273 (patch)
tree4cdbce09e500fb40edc970a5ab42072b041584a2 /java/src
parenta4d346c37a85cafbf4db0007765ba154ed78b84f (diff)
parent966efe48891cbdd364d94f1e72fa0435ab8f2b77 (diff)
downloadlatinime-50d1b7902f8a8115a542a27b5f1141d6d9193273.tar.gz
latinime-50d1b7902f8a8115a542a27b5f1141d6d9193273.tar.xz
latinime-50d1b7902f8a8115a542a27b5f1141d6d9193273.zip
Merge "Fix a bug with suggestion behavior (A81)"
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/Suggest.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index f810eccf4..d7aa87dca 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -174,7 +174,7 @@ public class Suggest {
: typedWord;
LatinImeLogger.onAddSuggestedWord(typedWord, Dictionary.TYPE_USER_TYPED);
- if (wordComposer.size() <= 1 && isCorrectionEnabled) {
+ if (wordComposer.size() <= 1) {
// At first character typed, search only the bigrams
if (!TextUtils.isEmpty(prevWordForBigram)) {
for (final String key : mDictionaries.keySet()) {
@@ -182,7 +182,7 @@ public class Suggest {
suggestionsSet.addAll(dictionary.getBigrams(wordComposer, prevWordForBigram));
}
}
- } else if (wordComposer.size() > 1) {
+ } else {
final WordComposer wordComposerForLookup;
if (trailingSingleQuotesCount > 0) {
wordComposerForLookup = new WordComposer(wordComposer);
@@ -216,6 +216,11 @@ public class Suggest {
mWhiteListDictionary.getWhitelistedWord(consideredWord);
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
+ // 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.isMostlyCaps()
|| wordComposer.isResumed() || !hasMainDictionary()) {
// If we don't have a main dictionary, we never want to auto-correct. The reason for