aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-07-10 02:24:58 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-07-10 02:24:58 -0700
commit184c5529174ac8e466f5f206267c88044598be79 (patch)
treea65f903703d817b06ada672e495b1207964b3a9a /java/src
parentb53e96813c971910327db86b3df5ef241c1efa28 (diff)
parent1c6693a219d546816d70fd092f887b73a8041ea3 (diff)
downloadlatinime-184c5529174ac8e466f5f206267c88044598be79.tar.gz
latinime-184c5529174ac8e466f5f206267c88044598be79.tar.xz
latinime-184c5529174ac8e466f5f206267c88044598be79.zip
Merge "Refactoring for whitelist (A83)"
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/Suggest.java3
-rw-r--r--java/src/com/android/inputmethod/latin/WhitelistDictionary.java11
2 files changed, 11 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index 00ca5aff0..421a44cd2 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -194,9 +194,6 @@ public class Suggest {
}
// At second character typed, search the unigrams (scores being affected by bigrams)
for (final String key : mDictionaries.keySet()) {
- // Skip WhitelistDictionary to lookup
- if (key.equals(Dictionary.TYPE_WHITELIST))
- continue;
final Dictionary dictionary = mDictionaries.get(key);
suggestionsSet.addAll(dictionary.getWords(
wordComposerForLookup, prevWordForBigram, proximityInfo));
diff --git a/java/src/com/android/inputmethod/latin/WhitelistDictionary.java b/java/src/com/android/inputmethod/latin/WhitelistDictionary.java
index 3af22140e..24c94992f 100644
--- a/java/src/com/android/inputmethod/latin/WhitelistDictionary.java
+++ b/java/src/com/android/inputmethod/latin/WhitelistDictionary.java
@@ -22,8 +22,11 @@ import android.text.TextUtils;
import android.util.Log;
import android.util.Pair;
+import com.android.inputmethod.keyboard.ProximityInfo;
import com.android.inputmethod.latin.LocaleUtils.RunInLocale;
+import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.Locale;
@@ -88,6 +91,14 @@ public class WhitelistDictionary extends ExpandableDictionary {
return null;
}
+ @Override
+ public ArrayList<SuggestedWordInfo> getWords(final WordComposer composer,
+ final CharSequence prevWord, final ProximityInfo proximityInfo) {
+ // Whitelist does not supply suggestions (actually it should not even implement the
+ // Dictionary interface, as it responds to none of it, but it does for legacy reasons)
+ return null;
+ }
+
// See LatinIME#updateSuggestions. This breaks in the (queer) case that the whitelist
// lists that word a should autocorrect to word b, and word c would autocorrect to
// an upper-cased version of a. In this case, the way this return value is used would