aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/Suggest.java
diff options
context:
space:
mode:
authorSatoshi Kataoka <satok@google.com>2012-07-18 23:14:35 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-07-18 23:14:37 -0700
commitb58ae231de089b29d009cfae92056e95fb81e2c4 (patch)
tree094a8ac9153395b2325eded51f2ce8e82b332d02 /java/src/com/android/inputmethod/latin/Suggest.java
parent147ca1300c4bceaaa57f92385a78ac129dfaef52 (diff)
parentd6a9416d7e7fda52453affdf1459f15cf15eab99 (diff)
downloadlatinime-b58ae231de089b29d009cfae92056e95fb81e2c4.tar.gz
latinime-b58ae231de089b29d009cfae92056e95fb81e2c4.tar.xz
latinime-b58ae231de089b29d009cfae92056e95fb81e2c4.zip
Merge "Merge remote-tracking branch 'goog/master' into mergescriptpackage" into jb-ub-latinimegoogle
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, 17 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index 31566bf13..598ef1de7 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -300,11 +300,27 @@ public class Suggest {
final ArrayList<SuggestedWordInfo> suggestionsContainer =
new ArrayList<SuggestedWordInfo>(suggestionsSet);
+ final int suggestionsCount = suggestionsContainer.size();
+ final boolean isFirstCharCapitalized = wordComposer.isAutoCapitalized();
+ // TODO: Handle the manual temporary shifted mode.
+ // TODO: Should handle TextUtils.CAP_MODE_CHARACTER.
+ final boolean isAllUpperCase = false;
+ if (isFirstCharCapitalized || isAllUpperCase) {
+ for (int i = 0; i < suggestionsCount; ++i) {
+ final SuggestedWordInfo wordInfo = suggestionsContainer.get(i);
+ final SuggestedWordInfo transformedWordInfo = getTransformedSuggestedWordInfo(
+ wordInfo, mLocale, isAllUpperCase, isFirstCharCapitalized,
+ 0 /* trailingSingleQuotesCount */);
+ suggestionsContainer.set(i, transformedWordInfo);
+ }
+ }
SuggestedWordInfo.removeDups(suggestionsContainer);
+ // In the batch input mode, the most relevant suggested word should act as a "typed word"
+ // (typedWordValid=true), not as an "auto correct word" (willAutoCorrect=false).
return new SuggestedWords(suggestionsContainer,
true /* typedWordValid */,
- true /* willAutoCorrect */,
+ false /* willAutoCorrect */,
false /* isPunctuationSuggestions */,
false /* isObsoleteSuggestions */,
false /* isPrediction */);