diff options
author | 2014-07-10 07:23:52 +0000 | |
---|---|---|
committer | 2014-07-09 17:22:29 +0000 | |
commit | 12e63799d37c21362b146df0d45449ae17d8b85f (patch) | |
tree | 60464f243268c2882fed2309b51bc017a5685878 /java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java | |
parent | facfd28a475b4a8369107ead340be295ca1b0358 (diff) | |
parent | 86dee2295dccd9af3c58e946bc8f2b62736c0260 (diff) | |
download | latinime-12e63799d37c21362b146df0d45449ae17d8b85f.tar.gz latinime-12e63799d37c21362b146df0d45449ae17d8b85f.tar.xz latinime-12e63799d37c21362b146df0d45449ae17d8b85f.zip |
Merge "Quit sorting suggestions in AndroidSpellCheckerService."
Diffstat (limited to 'java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java index 19c1dd0a5..ca0725e28 100644 --- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java +++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java @@ -259,14 +259,6 @@ public abstract class AndroidWordLevelSpellCheckerSession extends Session { } final String text = inText.replaceAll( AndroidSpellCheckerService.APOSTROPHE, AndroidSpellCheckerService.SINGLE_QUOTE); - - // TODO: Don't gather suggestions if the limit is <= 0 unless necessary - //final SuggestionsGatherer suggestionsGatherer = new SuggestionsGatherer(text, - //mService.mSuggestionThreshold, mService.mRecommendedThreshold, - //suggestionsLimit); - final SuggestionsGatherer suggestionsGatherer = mService.newSuggestionsGatherer( - text, suggestionsLimit); - final int capitalizeType = StringUtils.getCapitalizationType(text); boolean isInDict = true; if (!mService.hasMainDictionaryForLocale(mLocale)) { @@ -289,18 +281,13 @@ public abstract class AndroidWordLevelSpellCheckerSession extends Session { composer.setComposingWord(codePoints, coordinates); final SuggestionResults suggestionResults = mService.getSuggestionResults( mLocale, composer, prevWordsInfo, proximityInfo); - if (suggestionResults != null) { - for (final SuggestedWordInfo suggestion : suggestionResults) { - final String suggestionStr = suggestion.mWord; - suggestionsGatherer.addWord(suggestionStr.toCharArray(), null, 0, - suggestionStr.length(), suggestion.mScore); - } - } - isInDict = isInDictForAnyCapitalization(text, capitalizeType); - + // TODO: Don't gather suggestions if the limit is <= 0 unless necessary + final SuggestionsGatherer suggestionsGatherer = mService.newSuggestionsGatherer( + text, suggestionsLimit); + suggestionsGatherer.addResults(suggestionResults); final SuggestionsGatherer.Result result = suggestionsGatherer.getResults( capitalizeType, mLocale); - + isInDict = isInDictForAnyCapitalization(text, capitalizeType); if (DBG) { Log.i(TAG, "Spell checking results for " + text + " with suggestion limit " + suggestionsLimit); |