From db1939dbaa1de59eaf5693e2c89b02b323e9aac8 Mon Sep 17 00:00:00 2001 From: satok Date: Tue, 15 May 2012 17:43:31 +0900 Subject: Reorder suggestions result according to auto correction threshold Bug: 5413904 Change-Id: I3aa3a8109ba45d2129b58d8242866fd3dd3473cb --- java/src/com/android/inputmethod/latin/Suggest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'java/src/com/android/inputmethod/latin/Suggest.java') 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 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 suggestionsList = new ArrayList(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); } -- cgit v1.2.3-83-g751a