Read the suggestion type from the suggestion

...instead of dirtily passing it from the dictionary loop

Change-Id: I92ddbd7451609b69f6d4dc31bf89d614423b2016
main
Jean Chalard 2012-06-27 18:18:35 +09:00
parent 24eec0fa68
commit 3705ef407b
1 changed files with 5 additions and 4 deletions

View File

@ -221,7 +221,7 @@ public class Suggest {
localSuggestions.addAll(dictionary.getBigrams(wordComposer, lowerPrevWord));
}
for (final SuggestedWordInfo localSuggestion : localSuggestions) {
addWord(localSuggestion, key, suggestionsContainer);
addWord(localSuggestion, suggestionsContainer);
}
}
}
@ -245,7 +245,7 @@ public class Suggest {
final ArrayList<SuggestedWordInfo> localSuggestions = dictionary.getWords(
wordComposerForLookup, prevWordForBigram, proximityInfo);
for (final SuggestedWordInfo suggestion : localSuggestions) {
addWord(suggestion, key, suggestionsContainer);
addWord(suggestion, suggestionsContainer);
}
}
}
@ -370,7 +370,7 @@ public class Suggest {
private static final SuggestedWordInfoComparator sSuggestedWordInfoComparator =
new SuggestedWordInfoComparator();
public void addWord(final SuggestedWordInfo wordInfo, final String dictTypeKey,
public void addWord(final SuggestedWordInfo wordInfo,
final ArrayList<SuggestedWordInfo> suggestions) {
final int index =
Collections.binarySearch(suggestions, wordInfo, sSuggestedWordInfoComparator);
@ -385,7 +385,8 @@ public class Suggest {
if (suggestions.size() > MAX_SUGGESTIONS) {
suggestions.remove(MAX_SUGGESTIONS);
}
LatinImeLogger.onAddSuggestedWord(transformedWordInfo.mWord.toString(), dictTypeKey);
LatinImeLogger.onAddSuggestedWord(transformedWordInfo.mWord.toString(),
transformedWordInfo.mSourceDict);
}
private static SuggestedWordInfo getTransformedSuggestedWordInfo(