diff options
author | 2013-05-01 13:33:39 +0900 | |
---|---|---|
committer | 2013-05-01 18:21:56 +0900 | |
commit | d5781eef628c2cd4ac38029040746daa4679d637 (patch) | |
tree | 68c1ae758e67be2c46dce8daa40a085c0fcae05a /java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java | |
parent | df2eae6e69948e99618a28d087b847c70582efd8 (diff) | |
download | latinime-d5781eef628c2cd4ac38029040746daa4679d637.tar.gz latinime-d5781eef628c2cd4ac38029040746daa4679d637.tar.xz latinime-d5781eef628c2cd4ac38029040746daa4679d637.zip |
Fix Google spell checker tests
Bug: 8613307
Change-Id: Ief04a4abb6dc1f79660a2e419c9c5e271802b5a1
Diffstat (limited to 'java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java | 17 |
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; |