From d8afa2fbe13adf9f512fd294056a884a0edb0573 Mon Sep 17 00:00:00 2001 From: Jean Chalard <jchalard@google.com> Date: Wed, 11 Jul 2012 16:56:25 +0900 Subject: [PATCH] Remove the ultimate code duplication (A111) Change-Id: I7c76613df8f148feb02765f187db3ca6dc577977 --- .../android/inputmethod/latin/Suggest.java | 19 +++++-------------- 1 file 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 bbd415f68d..38094a518d 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" -- GitLab