aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
diff options
context:
space:
mode:
authorSatoshi Kataoka <satok@google.com>2013-05-01 09:31:52 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-05-01 09:31:52 +0000
commit1641a4a4576e73bbf0218178c885f448d669b472 (patch)
tree60bab19ddb0eac1bbbc2bfb448624cad672ee649 /java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
parent0caf3f6a04a706be6f69309b7d0869bf93accd56 (diff)
parentd5781eef628c2cd4ac38029040746daa4679d637 (diff)
downloadlatinime-1641a4a4576e73bbf0218178c885f448d669b472.tar.gz
latinime-1641a4a4576e73bbf0218178c885f448d669b472.tar.xz
latinime-1641a4a4576e73bbf0218178c885f448d669b472.zip
Merge "Fix Google spell checker tests"
Diffstat (limited to 'java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java')
-rw-r--r--java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java17
1 files changed, 3 insertions, 14 deletions
diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
index 2d0a89bb3..9e36e4bd6 100644
--- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
+++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java
@@ -64,8 +64,6 @@ public final class AndroidSpellCheckerService extends SpellCheckerService
CollectionUtils.newSynchronizedTreeMap();
private ContactsBinaryDictionary mContactsDictionary;
- // The threshold for a candidate to be offered as a suggestion.
- private float mSuggestionThreshold;
// The threshold for a suggestion to be considered "recommended".
private float mRecommendedThreshold;
// Whether to use the contacts dictionary
@@ -112,8 +110,6 @@ public final class AndroidSpellCheckerService extends SpellCheckerService
@Override public void onCreate() {
super.onCreate();
- mSuggestionThreshold =
- Float.parseFloat(getString(R.string.spellchecker_suggestion_threshold_value));
mRecommendedThreshold =
Float.parseFloat(getString(R.string.spellchecker_recommended_threshold_value));
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
@@ -198,8 +194,7 @@ public final class AndroidSpellCheckerService extends SpellCheckerService
}
public SuggestionsGatherer newSuggestionsGatherer(final String text, int maxLength) {
- return new SuggestionsGatherer(
- text, mSuggestionThreshold, mRecommendedThreshold, maxLength);
+ return new SuggestionsGatherer(text, mRecommendedThreshold, maxLength);
}
// TODO: remove this class and replace it by storage local to the session.
@@ -217,7 +212,6 @@ public final class AndroidSpellCheckerService extends SpellCheckerService
private final ArrayList<String> mSuggestions;
private final int[] mScores;
private final String mOriginalText;
- private final float mSuggestionThreshold;
private final float mRecommendedThreshold;
private final int mMaxLength;
private int mLength = 0;
@@ -227,10 +221,9 @@ public final class AndroidSpellCheckerService extends SpellCheckerService
private String mBestSuggestion = null;
private int mBestScore = Integer.MIN_VALUE; // As small as possible
- SuggestionsGatherer(final String originalText, final float suggestionThreshold,
- final float recommendedThreshold, final int maxLength) {
+ SuggestionsGatherer(final String originalText, final float recommendedThreshold,
+ final int maxLength) {
mOriginalText = originalText;
- mSuggestionThreshold = suggestionThreshold;
mRecommendedThreshold = recommendedThreshold;
mMaxLength = maxLength;
mSuggestions = CollectionUtils.newArrayList(maxLength + 1);
@@ -272,10 +265,6 @@ public final class AndroidSpellCheckerService extends SpellCheckerService
final String wordString = new String(word, wordOffset, wordLength);
final float normalizedScore =
BinaryDictionary.calcNormalizedScore(mOriginalText, wordString, score);
- if (normalizedScore < mSuggestionThreshold) {
- if (DBG) Log.i(TAG, wordString + " does not make the score threshold");
- return true;
- }
if (mLength < mMaxLength) {
final int copyLen = mLength - insertIndex;