aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2014-07-10 16:21:31 +0900
committerKeisuke Kuroyanagi <ksk@google.com>2014-07-10 16:21:31 +0900
commit86dee2295dccd9af3c58e946bc8f2b62736c0260 (patch)
treec71b8b9971a632a31b217326799477f2e1c85ac3 /java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java
parent9e76304d6004c43c3149bc2df460af2a00b18a4f (diff)
downloadlatinime-86dee2295dccd9af3c58e946bc8f2b62736c0260.tar.gz
latinime-86dee2295dccd9af3c58e946bc8f2b62736c0260.tar.xz
latinime-86dee2295dccd9af3c58e946bc8f2b62736c0260.zip
Quit sorting suggestions in AndroidSpellCheckerService.
Suggestions have been sorted in SuggestionResults. Bug: 13689011 Change-Id: Iec21e97119ceb7c71673d5b15bb1f06040b59fef
Diffstat (limited to 'java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java')
-rw-r--r--java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java23
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);