diff options
author | 2012-01-12 02:58:35 -0800 | |
---|---|---|
committer | 2012-01-12 02:58:35 -0800 | |
commit | 21814c56f0859a2d83d1ecc29f4a74210c4497a1 (patch) | |
tree | f6236e3c6040f91d381738db515d1a1bb0df422f /java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java | |
parent | ab34a4a7f53e1426a5cc4cd7a7fefde38a82e499 (diff) | |
parent | be0cf72253f15bff6abdeaa79f60a56f06ab7b86 (diff) | |
download | latinime-21814c56f0859a2d83d1ecc29f4a74210c4497a1.tar.gz latinime-21814c56f0859a2d83d1ecc29f4a74210c4497a1.tar.xz latinime-21814c56f0859a2d83d1ecc29f4a74210c4497a1.zip |
Merge "Move auto correction thresthold to the native code"
Diffstat (limited to 'java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java index 1ffee0de0..39e47f661 100644 --- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java +++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java @@ -270,7 +270,7 @@ public class AndroidSpellCheckerService extends SpellCheckerService // make the threshold. final String wordString = new String(word, wordOffset, wordLength); final double normalizedScore = - Utils.calcNormalizedScore(mOriginalText, wordString, score); + BinaryDictionary.calcNormalizedScore(mOriginalText, wordString, score); if (normalizedScore < mSuggestionThreshold) { if (DBG) Log.i(TAG, wordString + " does not make the score threshold"); return true; @@ -303,8 +303,8 @@ public class AndroidSpellCheckerService extends SpellCheckerService hasRecommendedSuggestions = false; } else { gatheredSuggestions = EMPTY_STRING_ARRAY; - final double normalizedScore = - Utils.calcNormalizedScore(mOriginalText, mBestSuggestion, mBestScore); + final double normalizedScore = BinaryDictionary.calcNormalizedScore( + mOriginalText, mBestSuggestion, mBestScore); hasRecommendedSuggestions = (normalizedScore > mRecommendedThreshold); } } else { @@ -338,7 +338,8 @@ public class AndroidSpellCheckerService extends SpellCheckerService final int bestScore = mScores[mLength - 1]; final CharSequence bestSuggestion = mSuggestions.get(0); final double normalizedScore = - Utils.calcNormalizedScore(mOriginalText, bestSuggestion, bestScore); + BinaryDictionary.calcNormalizedScore( + mOriginalText, bestSuggestion.toString(), bestScore); hasRecommendedSuggestions = (normalizedScore > mRecommendedThreshold); if (DBG) { Log.i(TAG, "Best suggestion : " + bestSuggestion + ", score " + bestScore); |