am 76218b96: Merge "Do not set "SuggestionSpan"s for suggestions from the next word predicition" into jb-dev

* commit '76218b966a6a712f3baa72d95c6d125d414cdbd4':
  Do not set "SuggestionSpan"s for suggestions from the next word predicition
This commit is contained in:
satok 2012-05-15 11:37:52 -07:00 committed by Android Git Automerger
commit d9c4aa83e1
5 changed files with 17 additions and 10 deletions

View file

@ -108,6 +108,7 @@ public class SuggestionSpanUtils {
if (!dictionaryAvailable || TextUtils.isEmpty(pickedWord)
|| CONSTRUCTOR_SuggestionSpan == null
|| suggestedWords == null || suggestedWords.size() == 0
|| suggestedWords.mIsPrediction || suggestedWords.mIsPunctuationSuggestions
|| OBJ_SUGGESTIONS_MAX_SIZE == null) {
return pickedWord;
}

View file

@ -886,7 +886,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
false /* hasAutoCorrectionCandidate */,
false /* allowsToBeAutoCorrected */,
false /* isPunctuationSuggestions */,
false /* isObsoleteSuggestions */);
false /* isObsoleteSuggestions */,
false /* isPrediction */);
// When in fullscreen mode, show completions generated by the application
final boolean isAutoCorrection = false;
setSuggestions(suggestedWords, isAutoCorrection);
@ -1781,7 +1782,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
false /* hasAutoCorrectionCandidate */,
false /* allowsToBeAutoCorrected */,
false /* isPunctuationSuggestions */,
true /* isObsoleteSuggestions */);
true /* isObsoleteSuggestions */,
false /* isPrediction */);
showSuggestions(obsoleteSuggestedWords, typedWord);
}
}

View file

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

View file

@ -253,13 +253,12 @@ public class Suggest implements Dictionary.WordCallback {
SuggestedWordInfo.removeDups(mSuggestions);
return new SuggestedWords(mSuggestions,
// TODO: Just assuming the suggestions that came from the bigram prediction are
// valid now. Need to assign a correct value for typedWordValid.
true /* typedWordValid */,
false /* typedWordValid */,
false /* hasAutoCorrectionCandidate */,
false /* allowsToBeAutoCorrected */,
false /* isPunctuationSuggestions */,
false /* isObsoleteSuggestions */);
false /* isObsoleteSuggestions */,
true /* isPrediction */);
}
// TODO: cleanup dictionaries looking up and suggestions building with SuggestedWords.Builder
@ -396,7 +395,8 @@ public class Suggest implements Dictionary.WordCallback {
autoCorrectionAvailable /* hasAutoCorrectionCandidate */,
allowsToBeAutoCorrected /* allowsToBeAutoCorrected */,
false /* isPunctuationSuggestions */,
false /* isObsoleteSuggestions */);
false /* isObsoleteSuggestions */,
false /* isPrediction */);
}
/**

View file

@ -25,13 +25,14 @@ import java.util.HashSet;
public class SuggestedWords {
public static final SuggestedWords EMPTY = new SuggestedWords(
new ArrayList<SuggestedWordInfo>(0), false, false, false, false, false);
new ArrayList<SuggestedWordInfo>(0), false, 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;
public final boolean mIsPrediction;
private final ArrayList<SuggestedWordInfo> mSuggestedWordInfoList;
public SuggestedWords(final ArrayList<SuggestedWordInfo> suggestedWordInfoList,
@ -39,13 +40,15 @@ public class SuggestedWords {
final boolean hasAutoCorrectionCandidate,
final boolean allowsToBeAutoCorrected,
final boolean isPunctuationSuggestions,
final boolean isObsoleteSuggestions) {
final boolean isObsoleteSuggestions,
final boolean isPrediction) {
mSuggestedWordInfoList = suggestedWordInfoList;
mTypedWordValid = typedWordValid;
mHasAutoCorrectionCandidate = hasAutoCorrectionCandidate;
mAllowsToBeAutoCorrected = allowsToBeAutoCorrected;
mIsPunctuationSuggestions = isPunctuationSuggestions;
mIsObsoleteSuggestions = isObsoleteSuggestions;
mIsPrediction = isPrediction;
}
public int size() {