diff options
author | 2012-07-09 18:25:27 +0900 | |
---|---|---|
committer | 2012-07-10 19:30:42 +0900 | |
commit | b30d2185f24e3d531f5d46249e7c97391705e469 (patch) | |
tree | ae9d84872437c992ac3e4d40369f54f13dd43ecb /java/src/com/android/inputmethod/latin/Dictionary.java | |
parent | a69f12a246b6c047faf7002a57b1cebc3721d731 (diff) | |
download | latinime-b30d2185f24e3d531f5d46249e7c97391705e469.tar.gz latinime-b30d2185f24e3d531f5d46249e7c97391705e469.tar.xz latinime-b30d2185f24e3d531f5d46249e7c97391705e469.zip |
Implement the common Dictionary interface (A89)
This will de-duplicate a lot of existing code.
Change-Id: Idaffb2fde23b9741f057bcb2ecb3dde9d12ea5c5
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Dictionary.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/Dictionary.java | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/java/src/com/android/inputmethod/latin/Dictionary.java b/java/src/com/android/inputmethod/latin/Dictionary.java index 4b02e11bf..38ef00da7 100644 --- a/java/src/com/android/inputmethod/latin/Dictionary.java +++ b/java/src/com/android/inputmethod/latin/Dictionary.java @@ -61,14 +61,8 @@ public abstract class Dictionary { */ // TODO: pass more context than just the previous word, to enable better suggestions (n-gram // and more) - public ArrayList<SuggestedWordInfo> getSuggestions(final WordComposer composer, - final CharSequence prevWord, final ProximityInfo proximityInfo) { - if (composer.size() <= 1) { - return TextUtils.isEmpty(prevWord) ? null : getBigrams(composer, prevWord); - } else { - return getWords(composer, prevWord, proximityInfo); - } - } + abstract public ArrayList<SuggestedWordInfo> getSuggestions(final WordComposer composer, + final CharSequence prevWord, final ProximityInfo proximityInfo); /** * Searches for words in the dictionary that match the characters in the composer. Matched @@ -78,6 +72,7 @@ public abstract class Dictionary { * @param proximityInfo the object for key proximity. May be ignored by some implementations. * @return the list of suggestions */ + // TODO: remove this abstract protected ArrayList<SuggestedWordInfo> getWords(final WordComposer composer, final CharSequence prevWordForBigrams, final ProximityInfo proximityInfo); @@ -87,6 +82,7 @@ public abstract class Dictionary { * @param previousWord the word before * @return the list of suggestions */ + // TODO: remove this abstract protected ArrayList<SuggestedWordInfo> getBigrams(final WordComposer composer, final CharSequence previousWord); |