diff options
author | 2012-07-18 16:23:15 +0900 | |
---|---|---|
committer | 2012-07-18 16:23:15 +0900 | |
commit | d6a9416d7e7fda52453affdf1459f15cf15eab99 (patch) | |
tree | 672b8cf90f82ef26e7360bfd8b54c9cdf16fb791 /java/src/com/android/inputmethod/latin/Suggest.java | |
parent | f5d95a9603687220912bdfa4d17784ec89c6f016 (diff) | |
parent | 3ec31f4971c3db7ef73488859609870d15f5dc69 (diff) | |
download | latinime-d6a9416d7e7fda52453affdf1459f15cf15eab99.tar.gz latinime-d6a9416d7e7fda52453affdf1459f15cf15eab99.tar.xz latinime-d6a9416d7e7fda52453affdf1459f15cf15eab99.zip |
Merge remote-tracking branch 'goog/master' into mergescriptpackage
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 */); |