diff options
author | 2012-07-13 14:01:02 +0900 | |
---|---|---|
committer | 2012-07-13 14:01:02 +0900 | |
commit | a004754b5705900362c6e8f9bb4bb62708f98242 (patch) | |
tree | 26b928a3ee40f9634be521a7ff1402b41aced4f8 /java/src/com/android/inputmethod/latin/Dictionary.java | |
parent | 5168480f301b76851bc4aed549fbc14ba6325136 (diff) | |
parent | e9808694fecbf7be776cd5cf8ec0333e158286b1 (diff) | |
download | latinime-a004754b5705900362c6e8f9bb4bb62708f98242.tar.gz latinime-a004754b5705900362c6e8f9bb4bb62708f98242.tar.xz latinime-a004754b5705900362c6e8f9bb4bb62708f98242.zip |
Merge remote-tracking branch 'goog/master' into mergescriptpackage
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Dictionary.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/Dictionary.java | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/java/src/com/android/inputmethod/latin/Dictionary.java b/java/src/com/android/inputmethod/latin/Dictionary.java index 0835450c1..fd40aa6da 100644 --- a/java/src/com/android/inputmethod/latin/Dictionary.java +++ b/java/src/com/android/inputmethod/latin/Dictionary.java @@ -16,6 +16,8 @@ package com.android.inputmethod.latin; +import android.text.TextUtils; + import com.android.inputmethod.keyboard.ProximityInfo; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; @@ -50,24 +52,17 @@ public abstract class Dictionary { } /** - * Searches for words in the dictionary that match the characters in the composer. Matched - * words are returned as an ArrayList. + * Searches for suggestions for a given context. For the moment the context is only the + * previous word. * @param composer the key sequence to match with coordinate info, as a WordComposer - * @param prevWordForBigrams the previous word, or null if none + * @param prevWord the previous word, or null if none * @param proximityInfo the object for key proximity. May be ignored by some implementations. - * @return the list of suggestions - */ - abstract public ArrayList<SuggestedWordInfo> getWords(final WordComposer composer, - final CharSequence prevWordForBigrams, final ProximityInfo proximityInfo); - - /** - * Searches for pairs in the bigram dictionary that matches the previous word. - * @param composer the key sequence to match - * @param previousWord the word before - * @return the list of suggestions + * @return the list of suggestions (possibly null if none) */ - public abstract ArrayList<SuggestedWordInfo> getBigrams(final WordComposer composer, - final CharSequence previousWord); + // TODO: pass more context than just the previous word, to enable better suggestions (n-gram + // and more) + abstract public ArrayList<SuggestedWordInfo> getSuggestions(final WordComposer composer, + final CharSequence prevWord, final ProximityInfo proximityInfo); /** * Checks if the given word occurs in the dictionary |