diff options
author | 2012-05-15 17:43:31 +0900 | |
---|---|---|
committer | 2012-05-16 19:58:48 +0900 | |
commit | db1939dbaa1de59eaf5693e2c89b02b323e9aac8 (patch) | |
tree | 9b67b48b8b83e9d3d5fc0bc3f0cdc9258517a9c2 /java | |
parent | 8dced70b062744a2c27e0cf6dcd0787cf598a97c (diff) | |
download | latinime-db1939dbaa1de59eaf5693e2c89b02b323e9aac8.tar.gz latinime-db1939dbaa1de59eaf5693e2c89b02b323e9aac8.tar.xz latinime-db1939dbaa1de59eaf5693e2c89b02b323e9aac8.zip |
Reorder suggestions result according to auto correction threshold
Bug: 5413904
Change-Id: I3aa3a8109ba45d2129b58d8242866fd3dd3473cb
Diffstat (limited to 'java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/Suggest.java | 5 |
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 845df81f6..ad2004a51 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -420,8 +420,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); @@ -430,10 +428,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); } |