Transform the whitelist suggestion like the others (A4)
...instead of having a different code path Change-Id: Icd177e2151e45d25300000d4b63d4fba1f52b6a8
This commit is contained in:
parent
33b3805e79
commit
4c4e3a0949
1 changed files with 7 additions and 16 deletions
|
@ -249,8 +249,8 @@ public class Suggest {
|
||||||
transformedWordInfo.mSourceDict);
|
transformedWordInfo.mSourceDict);
|
||||||
}
|
}
|
||||||
|
|
||||||
final CharSequence whitelistedWord = capitalizeWord(isAllUpperCase,
|
final CharSequence whitelistedWord =
|
||||||
isFirstCharCapitalized, mWhiteListDictionary.getWhitelistedWord(consideredWord));
|
mWhiteListDictionary.getWhitelistedWord(consideredWord);
|
||||||
|
|
||||||
final boolean hasAutoCorrection;
|
final boolean hasAutoCorrection;
|
||||||
if (isCorrectionEnabled) {
|
if (isCorrectionEnabled) {
|
||||||
|
@ -267,20 +267,11 @@ public class Suggest {
|
||||||
|
|
||||||
if (whitelistedWord != null) {
|
if (whitelistedWord != null) {
|
||||||
final SuggestedWordInfo whitelistSuggestion;
|
final SuggestedWordInfo whitelistSuggestion;
|
||||||
if (trailingSingleQuotesCount > 0) {
|
whitelistSuggestion = new SuggestedWordInfo(whitelistedWord,
|
||||||
final StringBuilder sb = new StringBuilder(whitelistedWord);
|
SuggestedWordInfo.MAX_SCORE, SuggestedWordInfo.KIND_WHITELIST,
|
||||||
for (int i = trailingSingleQuotesCount - 1; i >= 0; --i) {
|
Dictionary.TYPE_WHITELIST);
|
||||||
sb.appendCodePoint(Keyboard.CODE_SINGLE_QUOTE);
|
suggestionsContainer.add(0, getTransformedSuggestedWordInfo(whitelistSuggestion,
|
||||||
}
|
mLocale, isAllUpperCase, isFirstCharCapitalized, trailingSingleQuotesCount));
|
||||||
whitelistSuggestion = new SuggestedWordInfo(sb.toString(),
|
|
||||||
SuggestedWordInfo.MAX_SCORE, SuggestedWordInfo.KIND_WHITELIST,
|
|
||||||
Dictionary.TYPE_WHITELIST);
|
|
||||||
} else {
|
|
||||||
whitelistSuggestion = new SuggestedWordInfo(whitelistedWord,
|
|
||||||
SuggestedWordInfo.MAX_SCORE, SuggestedWordInfo.KIND_WHITELIST,
|
|
||||||
Dictionary.TYPE_WHITELIST);
|
|
||||||
}
|
|
||||||
suggestionsContainer.add(0, whitelistSuggestion);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isPrediction) {
|
if (!isPrediction) {
|
||||||
|
|
Loading…
Reference in a new issue