Add method to retreive suggestions from SuggestionHelper

Bug: 3414081
Change-Id: I96ffdd1c60fad933b32f7df023c51a9d10fcc53f
main
Tadashi G. Takaoka 2011-02-14 15:19:31 +09:00
parent 195e0f715f
commit aeab97695b
1 changed files with 5 additions and 0 deletions

View File

@ -91,6 +91,11 @@ public class SuggestHelper {
return mSuggest.isValidWord(typed); return mSuggest.isValidWord(typed);
} }
// TODO: This may be slow, but is OK for test so far.
public SuggestedWords getSuggestions(CharSequence typed) {
return mSuggest.getSuggestions(null, createWordComposer(typed), null);
}
public CharSequence getFirstSuggestion(CharSequence typed) { public CharSequence getFirstSuggestion(CharSequence typed) {
WordComposer word = createWordComposer(typed); WordComposer word = createWordComposer(typed);
SuggestedWords suggestions = mSuggest.getSuggestions(null, word, null); SuggestedWords suggestions = mSuggest.getSuggestions(null, word, null);