diff options
author | 2012-03-08 18:30:10 -0800 | |
---|---|---|
committer | 2012-03-08 18:30:10 -0800 | |
commit | 58722d83f02074a309bc2c447ca74f357f7c95f0 (patch) | |
tree | 86961a3e7f9270b054b418c94fdecf3dcbba4489 /java/src | |
parent | 0d2d451aa262d06e530ddb8d251694e573eaf20d (diff) | |
parent | 719f92fc77d10a55fe78daa5bce9617d8a0af335 (diff) | |
download | latinime-58722d83f02074a309bc2c447ca74f357f7c95f0.tar.gz latinime-58722d83f02074a309bc2c447ca74f357f7c95f0.tar.xz latinime-58722d83f02074a309bc2c447ca74f357f7c95f0.zip |
Merge "Stop uselessly remembering a value (A2)"
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/AutoCorrection.java | 6 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/Suggest.java | 6 |
2 files changed, 8 insertions, 4 deletions
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 671fb905d..e5ca11170 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -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)); |