diff options
author | 2012-07-18 23:14:35 -0700 | |
---|---|---|
committer | 2012-07-18 23:14:37 -0700 | |
commit | b58ae231de089b29d009cfae92056e95fb81e2c4 (patch) | |
tree | 094a8ac9153395b2325eded51f2ce8e82b332d02 /java/src/com/android/inputmethod/latin/Suggest.java | |
parent | 147ca1300c4bceaaa57f92385a78ac129dfaef52 (diff) | |
parent | d6a9416d7e7fda52453affdf1459f15cf15eab99 (diff) | |
download | latinime-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.java | 18 |
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 */); |