Reduction, step 5

Change-Id: Iac52e62c2bdffad14f916f69eade2b785bb41767
main
Jean Chalard 2012-03-09 18:18:24 +09:00
parent 0b96bc4b2b
commit dbd140504d
1 changed files with 3 additions and 11 deletions

View File

@ -263,8 +263,6 @@ public class Suggest implements Dictionary.WordCallback {
private static final WordComposer sEmptyWordComposer = new WordComposer(); private static final WordComposer sEmptyWordComposer = new WordComposer();
public SuggestedWords.Builder getBigramPredictionWordBuilder(CharSequence prevWordForBigram, public SuggestedWords.Builder getBigramPredictionWordBuilder(CharSequence prevWordForBigram,
final ProximityInfo proximityInfo, final int correctionMode) { final ProximityInfo proximityInfo, final int correctionMode) {
final WordComposer wordComposer = sEmptyWordComposer;
LatinImeLogger.onStartSuggestion(prevWordForBigram); LatinImeLogger.onStartSuggestion(prevWordForBigram);
mIsFirstCharCapitalized = false; mIsFirstCharCapitalized = false;
mIsAllUpperCase = false; mIsAllUpperCase = false;
@ -272,15 +270,10 @@ public class Suggest implements Dictionary.WordCallback {
collectGarbage(mSuggestions, mPrefMaxSuggestions); collectGarbage(mSuggestions, mPrefMaxSuggestions);
Arrays.fill(mScores, 0); Arrays.fill(mScores, 0);
final String typedWord = "";
final String consideredWord = "";
// Treating USER_TYPED as UNIGRAM suggestion for logging now. // Treating USER_TYPED as UNIGRAM suggestion for logging now.
LatinImeLogger.onAddSuggestedWord(typedWord, Suggest.DIC_USER_TYPED, LatinImeLogger.onAddSuggestedWord("", Suggest.DIC_USER_TYPED, Dictionary.UNIGRAM);
Dictionary.UNIGRAM);
mConsideredWord = ""; mConsideredWord = "";
final boolean allowsToBeAutoCorrected = false;
if (correctionMode == CORRECTION_FULL_BIGRAM) { if (correctionMode == CORRECTION_FULL_BIGRAM) {
// At first character typed, search only the bigrams // At first character typed, search only the bigrams
Arrays.fill(mBigramScores, 0); Arrays.fill(mBigramScores, 0);
@ -292,7 +285,7 @@ public class Suggest implements Dictionary.WordCallback {
prevWordForBigram = lowerPrevWord; prevWordForBigram = lowerPrevWord;
} }
for (final Dictionary dictionary : mBigramDictionaries.values()) { for (final Dictionary dictionary : mBigramDictionaries.values()) {
dictionary.getBigrams(wordComposer, prevWordForBigram, this); dictionary.getBigrams(sEmptyWordComposer, prevWordForBigram, this);
} }
// Nothing entered: return all bigrams for the previous word // Nothing entered: return all bigrams for the previous word
int insertCount = Math.min(mBigramSuggestions.size(), mPrefMaxSuggestions); int insertCount = Math.min(mBigramSuggestions.size(), mPrefMaxSuggestions);
@ -301,12 +294,11 @@ public class Suggest implements Dictionary.WordCallback {
} }
} }
} }
CharSequence whitelistedWord = null;
StringUtils.removeDupes(mSuggestions); StringUtils.removeDupes(mSuggestions);
return new SuggestedWords.Builder().addWords(mSuggestions, null) return new SuggestedWords.Builder().addWords(mSuggestions, null)
.setAllowsToBeAutoCorrected(allowsToBeAutoCorrected) .setAllowsToBeAutoCorrected(false)
.setHasAutoCorrection(false); .setHasAutoCorrection(false);
} }