Skip to content
Snippets Groups Projects
Commit d8afa2fb authored by Jean Chalard's avatar Jean Chalard
Browse files

Remove the ultimate code duplication (A111)

Change-Id: I7c76613df8f148feb02765f187db3ca6dc577977
parent 3b57631b
No related branches found
No related tags found
No related merge requests found
...@@ -192,20 +192,11 @@ public class Suggest { ...@@ -192,20 +192,11 @@ public class Suggest {
} else { } else {
wordComposerForLookup = wordComposer; wordComposerForLookup = wordComposer;
} }
if (wordComposerForLookup.size() <= 1) {
// At first character typed, search only the bigrams for (final String key : mDictionaries.keySet()) {
for (final String key : mDictionaries.keySet()) { final Dictionary dictionary = mDictionaries.get(key);
final Dictionary dictionary = mDictionaries.get(key); suggestionsSet.addAll(dictionary.getSuggestions(
suggestionsSet.addAll(dictionary.getSuggestions( wordComposerForLookup, prevWordForBigram, proximityInfo));
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));
}
} }
// TODO: Change this scheme - a boolean is not enough. A whitelisted word may be "valid" // TODO: Change this scheme - a boolean is not enough. A whitelisted word may be "valid"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment