aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/utils/SuggestionResults.java
diff options
context:
space:
mode:
authorDan Zivkovic <zivkovic@google.com>2015-02-25 15:57:59 -0800
committerDan Zivkovic <zivkovic@google.com>2015-02-25 17:59:58 -0800
commit5551302d275e3f54da9d86bcea633556ad12db8e (patch)
tree546240c21be53d829fe1521b6db126671e8e3594 /java/src/com/android/inputmethod/latin/utils/SuggestionResults.java
parented378c78a15757c7386d84c6cd7470d56ed00c76 (diff)
downloadlatinime-5551302d275e3f54da9d86bcea633556ad12db8e.tar.gz
latinime-5551302d275e3f54da9d86bcea633556ad12db8e.tar.xz
latinime-5551302d275e3f54da9d86bcea633556ad12db8e.zip
Don't assume that correctable words are invalid
Currently, the Delight3DictionaryFacilitator sets a boolean flag when the top suggestion score exceeds the auto-correction threshold. This flag is used to trigger auto-correction of the typed word. Also, the existing logic assumes that if allowsToBeAutoCorrected then the word is invalid, which is no longer true after we stopped using whitelists. Bug 19518376. Change-Id: Ifa7f6a09c07d25ac68c6cf3aec91f358bd88689f
Diffstat (limited to 'java/src/com/android/inputmethod/latin/utils/SuggestionResults.java')
-rw-r--r--java/src/com/android/inputmethod/latin/utils/SuggestionResults.java15
1 files changed, 6 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/latin/utils/SuggestionResults.java b/java/src/com/android/inputmethod/latin/utils/SuggestionResults.java
index 10e3994b6..981355115 100644
--- a/java/src/com/android/inputmethod/latin/utils/SuggestionResults.java
+++ b/java/src/com/android/inputmethod/latin/utils/SuggestionResults.java
@@ -33,21 +33,18 @@ public final class SuggestionResults extends TreeSet<SuggestedWordInfo> {
// TODO: Instead of a boolean , we may want to include the context of this suggestion results,
// such as {@link NgramContext}.
public final boolean mIsBeginningOfSentence;
- public final boolean mAutocorrectRecommendation;
+ public final boolean mFirstSuggestionExceedsConfidenceThreshold;
private final int mCapacity;
- public SuggestionResults(final int capacity, final boolean isBeginningOfSentence) {
- this(sSuggestedWordInfoComparator, capacity, isBeginningOfSentence, false);
- }
-
public SuggestionResults(final int capacity, final boolean isBeginningOfSentence,
- final boolean autocorrectRecommendation) {
+ final boolean firstSuggestionExceedsConfidenceThreshold) {
this(sSuggestedWordInfoComparator, capacity, isBeginningOfSentence,
- autocorrectRecommendation);
+ firstSuggestionExceedsConfidenceThreshold);
}
private SuggestionResults(final Comparator<SuggestedWordInfo> comparator, final int capacity,
- final boolean isBeginningOfSentence, final boolean autocorrectRecommendation) {
+ final boolean isBeginningOfSentence,
+ final boolean firstSuggestionExceedsConfidenceThreshold) {
super(comparator);
mCapacity = capacity;
if (ProductionFlags.INCLUDE_RAW_SUGGESTIONS) {
@@ -56,7 +53,7 @@ public final class SuggestionResults extends TreeSet<SuggestedWordInfo> {
mRawSuggestions = null;
}
mIsBeginningOfSentence = isBeginningOfSentence;
- mAutocorrectRecommendation = autocorrectRecommendation;
+ mFirstSuggestionExceedsConfidenceThreshold = firstSuggestionExceedsConfidenceThreshold;
}
@Override