Remove the ultimate code duplication (A111)
Change-Id: I7c76613df8f148feb02765f187db3ca6dc577977
This commit is contained in:
parent
3b57631b60
commit
d8afa2fbe1
1 changed files with 5 additions and 14 deletions
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue