Merge "Stop uselessly remembering a value (A2)"

This commit is contained in:
Jean Chalard 2012-03-08 18:30:10 -08:00 committed by Android (Google) Code Review
commit 58722d83f0
2 changed files with 8 additions and 4 deletions

View file

@ -118,15 +118,15 @@ public class AutoCorrection {
final int autoCorrectionSuggestionScore = sortedScores[0];
// TODO: when the normalized score of the first suggestion is nearly equals to
// the normalized score of the second suggestion, behave less aggressive.
mNormalizedScore = BinaryDictionary.calcNormalizedScore(
final double normalizedScore = BinaryDictionary.calcNormalizedScore(
typedWord.toString(), autoCorrectionSuggestion.toString(),
autoCorrectionSuggestionScore);
if (DBG) {
Log.d(TAG, "Normalized " + typedWord + "," + autoCorrectionSuggestion + ","
+ autoCorrectionSuggestionScore + ", " + mNormalizedScore
+ autoCorrectionSuggestionScore + ", " + normalizedScore
+ "(" + autoCorrectionThreshold + ")");
}
if (mNormalizedScore >= autoCorrectionThreshold) {
if (normalizedScore >= autoCorrectionThreshold) {
if (DBG) {
Log.d(TAG, "Auto corrected by S-threshold.");
}

View file

@ -388,7 +388,11 @@ public class Suggest implements Dictionary.WordCallback {
StringUtils.removeDupes(mSuggestions);
if (DBG) {
double normalizedScore = mAutoCorrection.getNormalizedScore();
final CharSequence autoCorrectionSuggestion = mSuggestions.get(0);
final int autoCorrectionSuggestionScore = mScores[0];
double normalizedScore = BinaryDictionary.calcNormalizedScore(
typedWord.toString(), autoCorrectionSuggestion.toString(),
autoCorrectionSuggestionScore);
ArrayList<SuggestedWords.SuggestedWordInfo> scoreInfoList =
new ArrayList<SuggestedWords.SuggestedWordInfo>();
scoreInfoList.add(new SuggestedWords.SuggestedWordInfo("+", false));