Add info for obsolete suggestions in SuggestedWords
Change-Id: I9684c7b08244b34853ce8a99b6e9d885389f6687
This commit is contained in:
parent
5f9593593e
commit
03a3517075
4 changed files with 15 additions and 7 deletions
|
@ -931,7 +931,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
|
||||||
false /* typedWordValid */,
|
false /* typedWordValid */,
|
||||||
false /* hasAutoCorrectionCandidate */,
|
false /* hasAutoCorrectionCandidate */,
|
||||||
false /* allowsToBeAutoCorrected */,
|
false /* allowsToBeAutoCorrected */,
|
||||||
false /* isPunctuationSuggestions */);
|
false /* isPunctuationSuggestions */,
|
||||||
|
false /* isObsoleteSuggestions */);
|
||||||
// When in fullscreen mode, show completions generated by the application
|
// When in fullscreen mode, show completions generated by the application
|
||||||
final boolean isAutoCorrection = false;
|
final boolean isAutoCorrection = false;
|
||||||
setSuggestions(suggestedWords, isAutoCorrection);
|
setSuggestions(suggestedWords, isAutoCorrection);
|
||||||
|
@ -1793,7 +1794,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
|
||||||
false /* typedWordValid */,
|
false /* typedWordValid */,
|
||||||
false /* hasAutoCorrectionCandidate */,
|
false /* hasAutoCorrectionCandidate */,
|
||||||
false /* allowsToBeAutoCorrected */,
|
false /* allowsToBeAutoCorrected */,
|
||||||
false /* isPunctuationSuggestions */);
|
false /* isPunctuationSuggestions */,
|
||||||
|
true /* isObsoleteSuggestions */);
|
||||||
showSuggestions(obsoleteSuggestedWords, typedWord);
|
showSuggestions(obsoleteSuggestedWords, typedWord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,7 +173,8 @@ public class SettingsValues {
|
||||||
false /* typedWordValid */,
|
false /* typedWordValid */,
|
||||||
false /* hasAutoCorrectionCandidate */,
|
false /* hasAutoCorrectionCandidate */,
|
||||||
false /* allowsToBeAutoCorrected */,
|
false /* allowsToBeAutoCorrected */,
|
||||||
true /* isPunctuationSuggestions */);
|
true /* isPunctuationSuggestions */,
|
||||||
|
false /* isObsoleteSuggestions */);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String createWordSeparators(final String weakSpaceStrippers,
|
private static String createWordSeparators(final String weakSpaceStrippers,
|
||||||
|
|
|
@ -274,7 +274,8 @@ public class Suggest implements Dictionary.WordCallback {
|
||||||
false /* typedWordValid */,
|
false /* typedWordValid */,
|
||||||
false /* hasAutoCorrectionCandidate */,
|
false /* hasAutoCorrectionCandidate */,
|
||||||
false /* allowsToBeAutoCorrected */,
|
false /* allowsToBeAutoCorrected */,
|
||||||
false /* isPunctuationSuggestions */);
|
false /* isPunctuationSuggestions */,
|
||||||
|
false /* isObsoleteSuggestions */);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: cleanup dictionaries looking up and suggestions building with SuggestedWords.Builder
|
// TODO: cleanup dictionaries looking up and suggestions building with SuggestedWords.Builder
|
||||||
|
@ -413,7 +414,8 @@ public class Suggest implements Dictionary.WordCallback {
|
||||||
!allowsToBeAutoCorrected /* typedWordValid */,
|
!allowsToBeAutoCorrected /* typedWordValid */,
|
||||||
autoCorrectionAvailable /* hasAutoCorrectionCandidate */,
|
autoCorrectionAvailable /* hasAutoCorrectionCandidate */,
|
||||||
allowsToBeAutoCorrected /* allowsToBeAutoCorrected */,
|
allowsToBeAutoCorrected /* allowsToBeAutoCorrected */,
|
||||||
false /* isPunctuationSuggestions */);
|
false /* isPunctuationSuggestions */,
|
||||||
|
false /* isObsoleteSuggestions */);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This assumes the scores[] array is at least as long as suggestions.size() - 1.
|
// This assumes the scores[] array is at least as long as suggestions.size() - 1.
|
||||||
|
|
|
@ -27,24 +27,27 @@ import java.util.List;
|
||||||
|
|
||||||
public class SuggestedWords {
|
public class SuggestedWords {
|
||||||
public static final SuggestedWords EMPTY = new SuggestedWords(
|
public static final SuggestedWords EMPTY = new SuggestedWords(
|
||||||
Collections.<SuggestedWordInfo>emptyList(), false, false, false, false);
|
Collections.<SuggestedWordInfo>emptyList(), false, false, false, false, false);
|
||||||
|
|
||||||
public final boolean mTypedWordValid;
|
public final boolean mTypedWordValid;
|
||||||
public final boolean mHasAutoCorrectionCandidate;
|
public final boolean mHasAutoCorrectionCandidate;
|
||||||
public final boolean mIsPunctuationSuggestions;
|
public final boolean mIsPunctuationSuggestions;
|
||||||
public final boolean mAllowsToBeAutoCorrected;
|
public final boolean mAllowsToBeAutoCorrected;
|
||||||
|
public final boolean mIsObsoleteSuggestions;
|
||||||
private final List<SuggestedWordInfo> mSuggestedWordInfoList;
|
private final List<SuggestedWordInfo> mSuggestedWordInfoList;
|
||||||
|
|
||||||
public SuggestedWords(final List<SuggestedWordInfo> suggestedWordInfoList,
|
public SuggestedWords(final List<SuggestedWordInfo> suggestedWordInfoList,
|
||||||
final boolean typedWordValid,
|
final boolean typedWordValid,
|
||||||
final boolean hasAutoCorrectionCandidate,
|
final boolean hasAutoCorrectionCandidate,
|
||||||
final boolean allowsToBeAutoCorrected,
|
final boolean allowsToBeAutoCorrected,
|
||||||
final boolean isPunctuationSuggestions) {
|
final boolean isPunctuationSuggestions,
|
||||||
|
final boolean isObsoleteSuggestions) {
|
||||||
mSuggestedWordInfoList = suggestedWordInfoList;
|
mSuggestedWordInfoList = suggestedWordInfoList;
|
||||||
mTypedWordValid = typedWordValid;
|
mTypedWordValid = typedWordValid;
|
||||||
mHasAutoCorrectionCandidate = hasAutoCorrectionCandidate;
|
mHasAutoCorrectionCandidate = hasAutoCorrectionCandidate;
|
||||||
mAllowsToBeAutoCorrected = allowsToBeAutoCorrected;
|
mAllowsToBeAutoCorrected = allowsToBeAutoCorrected;
|
||||||
mIsPunctuationSuggestions = isPunctuationSuggestions;
|
mIsPunctuationSuggestions = isPunctuationSuggestions;
|
||||||
|
mIsObsoleteSuggestions = isObsoleteSuggestions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int size() {
|
public int size() {
|
||||||
|
|
Loading…
Reference in a new issue