diff --git a/java/src/com/android/inputmethod/latin/AutoCorrection.java b/java/src/com/android/inputmethod/latin/AutoCorrection.java index 425b5c3f3..51b51f55b 100644 --- a/java/src/com/android/inputmethod/latin/AutoCorrection.java +++ b/java/src/com/android/inputmethod/latin/AutoCorrection.java @@ -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."); } diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index 298ead665..6f2ca83a8 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -386,7 +386,11 @@ public class Suggest implements Dictionary.WordCallback { Utils.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 scoreInfoList = new ArrayList(); scoreInfoList.add(new SuggestedWords.SuggestedWordInfo("+", false));