Add info for obsolete suggestions in SuggestedWords

Change-Id: I9684c7b08244b34853ce8a99b6e9d885389f6687
This commit is contained in:
Jean Chalard 2012-03-15 13:12:08 +09:00
parent 5f9593593e
commit 03a3517075
4 changed files with 15 additions and 7 deletions

View file

@ -931,7 +931,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
false /* typedWordValid */,
false /* hasAutoCorrectionCandidate */,
false /* allowsToBeAutoCorrected */,
false /* isPunctuationSuggestions */);
false /* isPunctuationSuggestions */,
false /* isObsoleteSuggestions */);
// When in fullscreen mode, show completions generated by the application
final boolean isAutoCorrection = false;
setSuggestions(suggestedWords, isAutoCorrection);
@ -1793,7 +1794,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
false /* typedWordValid */,
false /* hasAutoCorrectionCandidate */,
false /* allowsToBeAutoCorrected */,
false /* isPunctuationSuggestions */);
false /* isPunctuationSuggestions */,
true /* isObsoleteSuggestions */);
showSuggestions(obsoleteSuggestedWords, typedWord);
}
}

View file

@ -173,7 +173,8 @@ public class SettingsValues {
false /* typedWordValid */,
false /* hasAutoCorrectionCandidate */,
false /* allowsToBeAutoCorrected */,
true /* isPunctuationSuggestions */);
true /* isPunctuationSuggestions */,
false /* isObsoleteSuggestions */);
}
private static String createWordSeparators(final String weakSpaceStrippers,

View file

@ -274,7 +274,8 @@ public class Suggest implements Dictionary.WordCallback {
false /* typedWordValid */,
false /* hasAutoCorrectionCandidate */,
false /* allowsToBeAutoCorrected */,
false /* isPunctuationSuggestions */);
false /* isPunctuationSuggestions */,
false /* isObsoleteSuggestions */);
}
// TODO: cleanup dictionaries looking up and suggestions building with SuggestedWords.Builder
@ -413,7 +414,8 @@ public class Suggest implements Dictionary.WordCallback {
!allowsToBeAutoCorrected /* typedWordValid */,
autoCorrectionAvailable /* hasAutoCorrectionCandidate */,
allowsToBeAutoCorrected /* allowsToBeAutoCorrected */,
false /* isPunctuationSuggestions */);
false /* isPunctuationSuggestions */,
false /* isObsoleteSuggestions */);
}
// This assumes the scores[] array is at least as long as suggestions.size() - 1.

View file

@ -27,24 +27,27 @@ import java.util.List;
public class 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 mHasAutoCorrectionCandidate;
public final boolean mIsPunctuationSuggestions;
public final boolean mAllowsToBeAutoCorrected;
public final boolean mIsObsoleteSuggestions;
private final List<SuggestedWordInfo> mSuggestedWordInfoList;
public SuggestedWords(final List<SuggestedWordInfo> suggestedWordInfoList,
final boolean typedWordValid,
final boolean hasAutoCorrectionCandidate,
final boolean allowsToBeAutoCorrected,
final boolean isPunctuationSuggestions) {
final boolean isPunctuationSuggestions,
final boolean isObsoleteSuggestions) {
mSuggestedWordInfoList = suggestedWordInfoList;
mTypedWordValid = typedWordValid;
mHasAutoCorrectionCandidate = hasAutoCorrectionCandidate;
mAllowsToBeAutoCorrected = allowsToBeAutoCorrected;
mIsPunctuationSuggestions = isPunctuationSuggestions;
mIsObsoleteSuggestions = isObsoleteSuggestions;
}
public int size() {