diff options
author | 2012-07-11 16:56:25 +0900 | |
---|---|---|
committer | 2012-07-12 14:30:33 +0900 | |
commit | d8afa2fbe13adf9f512fd294056a884a0edb0573 (patch) | |
tree | 791bb509a59fe8fcc1f1f1fb5b80bd05ac5cd515 /java/src | |
parent | 3b57631b60c696d407a73e7594f6ab2418932229 (diff) | |
download | latinime-d8afa2fbe13adf9f512fd294056a884a0edb0573.tar.gz latinime-d8afa2fbe13adf9f512fd294056a884a0edb0573.tar.xz latinime-d8afa2fbe13adf9f512fd294056a884a0edb0573.zip |
Remove the ultimate code duplication (A111)
Change-Id: I7c76613df8f148feb02765f187db3ca6dc577977
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/Suggest.java | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index bbd415f68..38094a518 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -192,20 +192,11 @@ public class Suggest { } else { wordComposerForLookup = wordComposer; } - if (wordComposerForLookup.size() <= 1) { - // At first character typed, search only the bigrams - for (final String key : mDictionaries.keySet()) { - final Dictionary dictionary = mDictionaries.get(key); - suggestionsSet.addAll(dictionary.getSuggestions( - wordComposerForLookup, prevWordForBigram, proximityInfo)); - } - } else { - // At second character typed, search the unigrams (scores being affected by bigrams) - for (final String key : mDictionaries.keySet()) { - final Dictionary dictionary = mDictionaries.get(key); - suggestionsSet.addAll(dictionary.getSuggestions( - wordComposerForLookup, prevWordForBigram, proximityInfo)); - } + + for (final String key : mDictionaries.keySet()) { + final Dictionary dictionary = mDictionaries.get(key); + suggestionsSet.addAll(dictionary.getSuggestions( + wordComposerForLookup, prevWordForBigram, proximityInfo)); } // TODO: Change this scheme - a boolean is not enough. A whitelisted word may be "valid" |