aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorsatok <satok@google.com>2012-05-16 04:42:56 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-05-16 04:42:56 -0700
commit080bc96786af391d508d2d2f91a407db71345539 (patch)
tree4757ffc3755a2dff5355e6699c9bea714b473cc8 /java/src
parentcc4234d90edde4b9f388a7c23f51567246bef14e (diff)
parentf837b57bf51b2767ec62a6140b28d84383ad75b1 (diff)
downloadlatinime-080bc96786af391d508d2d2f91a407db71345539.tar.gz
latinime-080bc96786af391d508d2d2f91a407db71345539.tar.xz
latinime-080bc96786af391d508d2d2f91a407db71345539.zip
am f837b57b: Merge "Reorder suggestions result according to auto correction threshold" into jb-dev
* commit 'f837b57bf51b2767ec62a6140b28d84383ad75b1': Reorder suggestions result according to auto correction threshold
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/Suggest.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index 7832cb522..d7cd0575b 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -408,8 +408,6 @@ public class Suggest implements Dictionary.WordCallback {
final String typedWord, final ArrayList<SuggestedWordInfo> suggestions) {
final SuggestedWordInfo typedWordInfo = suggestions.get(0);
typedWordInfo.setDebugString("+");
- double normalizedScore = BinaryDictionary.calcNormalizedScore(
- typedWord, typedWordInfo.toString(), typedWordInfo.mScore);
final int suggestionsSize = suggestions.size();
final ArrayList<SuggestedWordInfo> suggestionsList =
new ArrayList<SuggestedWordInfo>(suggestionsSize);
@@ -418,10 +416,11 @@ public class Suggest implements Dictionary.WordCallback {
// than i because we added the typed word to mSuggestions without touching mScores.
for (int i = 0; i < suggestionsSize - 1; ++i) {
final SuggestedWordInfo cur = suggestions.get(i + 1);
+ final double normalizedScore = BinaryDictionary.calcNormalizedScore(
+ typedWord, cur.toString(), cur.mScore);
final String scoreInfoString;
if (normalizedScore > 0) {
scoreInfoString = String.format("%d (%4.2f)", cur.mScore, normalizedScore);
- normalizedScore = 0.0;
} else {
scoreInfoString = Integer.toString(cur.mScore);
}