aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/Suggest.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-03-08 20:35:47 +0900
committerJean Chalard <jchalard@google.com>2012-03-08 20:55:37 +0900
commit719f92fc77d10a55fe78daa5bce9617d8a0af335 (patch)
treed258b438b4e92ed7b68d73804cc10e1db1fc4eba /java/src/com/android/inputmethod/latin/Suggest.java
parentec0fca8a8ba70c0d960838399e248db169d617d0 (diff)
downloadlatinime-719f92fc77d10a55fe78daa5bce9617d8a0af335.tar.gz
latinime-719f92fc77d10a55fe78daa5bce9617d8a0af335.tar.xz
latinime-719f92fc77d10a55fe78daa5bce9617d8a0af335.zip
Stop uselessly remembering a value (A2)
The value is only used in debug mode, and it can be recomputed at the time. This change does not impact the logic. There is however a side effect: in debug mode, the normalized score will be displayed also when the word comes out of the whitelist or is a valid word. It's actually a good thing. The end purpose is to make all methods in AutoCorrection static. Change-Id: I1642b1fdfa6ae62b8aa2fed94a8a26ff4a7e4d0e
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Suggest.java')
-rw-r--r--java/src/com/android/inputmethod/latin/Suggest.java6
1 files changed, 5 insertions, 1 deletions
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<SuggestedWords.SuggestedWordInfo> scoreInfoList =
new ArrayList<SuggestedWords.SuggestedWordInfo>();
scoreInfoList.add(new SuggestedWords.SuggestedWordInfo("+", false));