Merge "Remove rejected suggestion in LatinIME."

main
Dan Zivkovic 2015-03-17 18:14:13 +00:00 committed by Android (Google) Code Review
commit a10808d7d6
2 changed files with 6 additions and 2 deletions

View File

@ -34,4 +34,5 @@ public class DecoderSpecificConstants {
public static final boolean SHOULD_VERIFY_CHECKSUM = true; public static final boolean SHOULD_VERIFY_CHECKSUM = true;
public static final boolean SHOULD_USE_DICT_VERSION = true; public static final boolean SHOULD_USE_DICT_VERSION = true;
public static final boolean SHOULD_AUTO_CORRECT_USING_NON_WHITE_LISTED_SUGGESTION = false; public static final boolean SHOULD_AUTO_CORRECT_USING_NON_WHITE_LISTED_SUGGESTION = false;
public static final boolean SHOULD_REMOVE_PREVIOUSLY_REJECTED_SUGGESTION = true;
} }

View File

@ -19,6 +19,7 @@ package com.android.inputmethod.latin;
import android.text.TextUtils; import android.text.TextUtils;
import static com.android.inputmethod.latin.define.DecoderSpecificConstants.SHOULD_AUTO_CORRECT_USING_NON_WHITE_LISTED_SUGGESTION; import static com.android.inputmethod.latin.define.DecoderSpecificConstants.SHOULD_AUTO_CORRECT_USING_NON_WHITE_LISTED_SUGGESTION;
import static com.android.inputmethod.latin.define.DecoderSpecificConstants.SHOULD_REMOVE_PREVIOUSLY_REJECTED_SUGGESTION;
import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.keyboard.Keyboard;
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
@ -311,7 +312,9 @@ public final class Suggest {
} }
} }
if (suggestionsContainer.size() > 1 && TextUtils.equals(suggestionsContainer.get(0).mWord, if (SHOULD_REMOVE_PREVIOUSLY_REJECTED_SUGGESTION
&& suggestionsContainer.size() > 1
&& TextUtils.equals(suggestionsContainer.get(0).mWord,
wordComposer.getRejectedBatchModeSuggestion())) { wordComposer.getRejectedBatchModeSuggestion())) {
final SuggestedWordInfo rejected = suggestionsContainer.remove(0); final SuggestedWordInfo rejected = suggestionsContainer.remove(0);
suggestionsContainer.add(1, rejected); suggestionsContainer.add(1, rejected);