Merge "Do away with Utils#addAllSuggestions (A14)"
commit
582b69b317
|
@ -141,7 +141,6 @@ public class BinaryDictionary extends Dictionary {
|
|||
mBigramScores[j], SuggestedWordInfo.KIND_CORRECTION));
|
||||
}
|
||||
}
|
||||
Utils.addAllSuggestions(mDicTypeId, Dictionary.BIGRAM, suggestions, callback);
|
||||
return suggestions;
|
||||
}
|
||||
|
||||
|
@ -168,7 +167,6 @@ public class BinaryDictionary extends Dictionary {
|
|||
mScores[j], SuggestedWordInfo.KIND_CORRECTION));
|
||||
}
|
||||
}
|
||||
Utils.addAllSuggestions(mDicTypeId, Dictionary.UNIGRAM, suggestions, callback);
|
||||
return suggestions;
|
||||
}
|
||||
|
||||
|
|
|
@ -262,7 +262,6 @@ public class ExpandableDictionary extends Dictionary {
|
|||
}
|
||||
final ArrayList<SuggestedWordInfo> suggestions =
|
||||
getWordsInner(codes, prevWordForBigrams, proximityInfo);
|
||||
Utils.addAllSuggestions(mDicTypeId, Dictionary.UNIGRAM, suggestions, callback);
|
||||
return suggestions;
|
||||
}
|
||||
|
||||
|
@ -618,7 +617,6 @@ public class ExpandableDictionary extends Dictionary {
|
|||
if (!reloadDictionaryIfRequired()) {
|
||||
final ArrayList<SuggestedWordInfo> suggestions = new ArrayList<SuggestedWordInfo>();
|
||||
runBigramReverseLookUp(previousWord, suggestions);
|
||||
Utils.addAllSuggestions(mDicTypeId, Dictionary.BIGRAM, suggestions, callback);
|
||||
return suggestions;
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -531,14 +531,4 @@ public class Utils {
|
|||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
public static void addAllSuggestions(final int dicTypeId, final int dataType,
|
||||
final ArrayList<SuggestedWords.SuggestedWordInfo> suggestions,
|
||||
final Dictionary.WordCallback callback) {
|
||||
for (SuggestedWordInfo suggestion : suggestions) {
|
||||
final String suggestionStr = suggestion.mWord.toString();
|
||||
callback.addWord(suggestionStr.toCharArray(), null, 0, suggestionStr.length(),
|
||||
suggestion.mScore, dicTypeId, dataType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -792,7 +792,7 @@ public class AndroidSpellCheckerService extends SpellCheckerService
|
|||
composer, prevWord, suggestionsGatherer, dictInfo.mProximityInfo);
|
||||
for (final SuggestedWordInfo suggestion : suggestions) {
|
||||
final String suggestionStr = suggestion.mWord.toString();
|
||||
suggestionsGatherer.oldAddWord(suggestionStr.toCharArray(), 0,
|
||||
suggestionsGatherer.oldAddWord(suggestionStr.toCharArray(), null, 0,
|
||||
suggestionStr.length(), suggestion.mScore, 0 /* ignored */,
|
||||
Dictionary.UNIGRAM);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue