Skip to content
Snippets Groups Projects
Commit 858045b4 authored by Keisuke Kuroyanagi's avatar Keisuke Kuroyanagi Committed by Android (Google) Code Review
Browse files

Merge "Fix: wrong auto correction for whilelist and personalized words."

parents 5128935a 23ae574a
No related branches found
No related tags found
No related merge requests found
......@@ -142,8 +142,8 @@ public final class Suggest {
whitelistedWord = firstSuggestion = null;
} else {
final SuggestedWordInfo firstSuggestedWordInfo = getTransformedSuggestedWordInfo(
suggestionsSet.first(), mLocale, isAllUpperCase, isFirstCharCapitalized,
trailingSingleQuotesCount);
suggestionsSet.first(), mLocale, isAllUpperCase, isFirstCharCapitalized,
trailingSingleQuotesCount);
firstSuggestion = firstSuggestedWordInfo.mWord;
if (SuggestedWordInfo.KIND_WHITELIST != firstSuggestedWordInfo.mKind) {
whitelistedWord = null;
......@@ -161,10 +161,10 @@ public final class Suggest {
// TODO: stop relying on indices to find where is the auto-correction in the suggested
// words, and correct this test.
final boolean allowsToBeAutoCorrected = (null != whitelistedWord
&& !whitelistedWord.equals(consideredWord))
&& !whitelistedWord.equals(typedWord))
|| (consideredWord.length() > 1 && !mDictionaryFacilitator.isValidWord(
consideredWord, wordComposer.isFirstCharCapitalized())
&& !consideredWord.equals(firstSuggestion));
&& !typedWord.equals(firstSuggestion));
final boolean hasAutoCorrection;
// TODO: using isCorrectionEnabled here is not very good. It's probably useless, because
......
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