diff options
author | 2012-07-09 15:54:19 +0900 | |
---|---|---|
committer | 2012-07-10 18:05:20 +0900 | |
commit | c677b0071d51a277413079b30f2215605637aa6b (patch) | |
tree | 9e3436902b936750bcb96d60b47931d67fb0ed78 /java/src | |
parent | 1c6693a219d546816d70fd092f887b73a8041ea3 (diff) | |
download | latinime-c677b0071d51a277413079b30f2215605637aa6b.tar.gz latinime-c677b0071d51a277413079b30f2215605637aa6b.tar.xz latinime-c677b0071d51a277413079b30f2215605637aa6b.zip |
Enhance behavior consistency (A84)
Use the word the same way for suggestion and prediction. It makes
little logical sense that the trailing single quotes be removed
for suggestion lookup but not for prediction lookup.
Change-Id: I0de4b5f7c5b4c1b4ba1817ff9653d7c03967146d
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/Suggest.java | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index 421a44cd2..855971161 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -174,24 +174,25 @@ public class Suggest { : typedWord; LatinImeLogger.onAddSuggestedWord(typedWord, Dictionary.TYPE_USER_TYPED); - if (wordComposer.size() <= 1) { + final WordComposer wordComposerForLookup; + if (trailingSingleQuotesCount > 0) { + wordComposerForLookup = new WordComposer(wordComposer); + for (int i = trailingSingleQuotesCount - 1; i >= 0; --i) { + wordComposerForLookup.deleteLast(); + } + } else { + wordComposerForLookup = wordComposer; + } + if (wordComposerForLookup.size() <= 1) { // At first character typed, search only the bigrams if (!TextUtils.isEmpty(prevWordForBigram)) { for (final String key : mDictionaries.keySet()) { final Dictionary dictionary = mDictionaries.get(key); - suggestionsSet.addAll(dictionary.getBigrams(wordComposer, prevWordForBigram)); + suggestionsSet.addAll(dictionary.getBigrams(wordComposerForLookup, + prevWordForBigram)); } } } else { - final WordComposer wordComposerForLookup; - if (trailingSingleQuotesCount > 0) { - wordComposerForLookup = new WordComposer(wordComposer); - for (int i = trailingSingleQuotesCount - 1; i >= 0; --i) { - wordComposerForLookup.deleteLast(); - } - } else { - wordComposerForLookup = wordComposer; - } // At second character typed, search the unigrams (scores being affected by bigrams) for (final String key : mDictionaries.keySet()) { final Dictionary dictionary = mDictionaries.get(key); |