Stop special-casing a single suggestion (A6)

Treat it like the others

Change-Id: Ic24e40ada0e75773c3ece9470ab61c350697be5d
main
Jean Chalard 2012-06-28 13:52:48 +09:00
parent 251bb70f08
commit ed83d4b143
1 changed files with 12 additions and 13 deletions

View File

@ -221,17 +221,6 @@ public class Suggest {
} }
} }
final ArrayList<SuggestedWordInfo> suggestionsContainer =
new ArrayList<SuggestedWordInfo>(suggestionsSet);
for (int i = 0; i < suggestionsContainer.size(); ++i) {
final SuggestedWordInfo wordInfo = suggestionsContainer.get(i);
final SuggestedWordInfo transformedWordInfo = getTransformedSuggestedWordInfo(wordInfo,
mLocale, isAllUpperCase, isFirstCharCapitalized, trailingSingleQuotesCount);
suggestionsContainer.set(i, transformedWordInfo);
LatinImeLogger.onAddSuggestedWord(transformedWordInfo.mWord.toString(),
transformedWordInfo.mSourceDict);
}
final CharSequence whitelistedWord = final CharSequence whitelistedWord =
mWhiteListDictionary.getWhitelistedWord(consideredWord); mWhiteListDictionary.getWhitelistedWord(consideredWord);
@ -253,8 +242,18 @@ public class Suggest {
whitelistSuggestion = new SuggestedWordInfo(whitelistedWord, whitelistSuggestion = new SuggestedWordInfo(whitelistedWord,
SuggestedWordInfo.MAX_SCORE, SuggestedWordInfo.KIND_WHITELIST, SuggestedWordInfo.MAX_SCORE, SuggestedWordInfo.KIND_WHITELIST,
Dictionary.TYPE_WHITELIST); Dictionary.TYPE_WHITELIST);
suggestionsContainer.add(0, getTransformedSuggestedWordInfo(whitelistSuggestion, suggestionsSet.add(whitelistSuggestion);
mLocale, isAllUpperCase, isFirstCharCapitalized, trailingSingleQuotesCount)); }
final ArrayList<SuggestedWordInfo> suggestionsContainer =
new ArrayList<SuggestedWordInfo>(suggestionsSet);
for (int i = 0; i < suggestionsContainer.size(); ++i) {
final SuggestedWordInfo wordInfo = suggestionsContainer.get(i);
final SuggestedWordInfo transformedWordInfo = getTransformedSuggestedWordInfo(wordInfo,
mLocale, isAllUpperCase, isFirstCharCapitalized, trailingSingleQuotesCount);
suggestionsContainer.set(i, transformedWordInfo);
LatinImeLogger.onAddSuggestedWord(transformedWordInfo.mWord.toString(),
transformedWordInfo.mSourceDict);
} }
if (!isPrediction) { if (!isPrediction) {