aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
diff options
context:
space:
mode:
authorsatok <satok@google.com>2012-01-12 03:00:54 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2012-01-12 03:00:54 -0800
commit280cc53e1c4702e724915a78d00e00e552f7003f (patch)
treef6236e3c6040f91d381738db515d1a1bb0df422f /java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
parentae2a4eedd22d73ecae680d022972dcaacb7c6702 (diff)
parent21814c56f0859a2d83d1ecc29f4a74210c4497a1 (diff)
downloadlatinime-280cc53e1c4702e724915a78d00e00e552f7003f.tar.gz
latinime-280cc53e1c4702e724915a78d00e00e552f7003f.tar.xz
latinime-280cc53e1c4702e724915a78d00e00e552f7003f.zip
am 21814c56: Merge "Move auto correction thresthold to the native code"
* commit '21814c56f0859a2d83d1ecc29f4a74210c4497a1': 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.java9
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);