aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/Suggest.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2011-06-13 01:48:00 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-06-13 01:48:00 -0700
commit90cb2e6296726960b12e622ffa2b30c5ff92a079 (patch)
treec1fe255aff608980f006ca05815d32393e7a4586 /java/src/com/android/inputmethod/latin/Suggest.java
parent070760dc5abdb9a850a94c509eeb9f486515af59 (diff)
parent699094f9b6e0a4621e8b3cfab70b59c0c7c086bb (diff)
downloadlatinime-90cb2e6296726960b12e622ffa2b30c5ff92a079.tar.gz
latinime-90cb2e6296726960b12e622ffa2b30c5ff92a079.tar.xz
latinime-90cb2e6296726960b12e622ffa2b30c5ff92a079.zip
Merge "Add an option to use or not the contacts dictionary."
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Suggest.java')
-rw-r--r--java/src/com/android/inputmethod/latin/Suggest.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index ca75866c0..33f9820cc 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -184,12 +184,17 @@ public class Suggest implements Dictionary.WordCallback {
}
/**
- * Sets an optional contacts dictionary resource to be loaded.
+ * Sets an optional contacts dictionary resource to be loaded. It is also possible to remove
+ * the contacts dictionary by passing null to this method. In this case no contacts dictionary
+ * won't be used.
*/
public void setContactsDictionary(Dictionary contactsDictionary) {
if (contactsDictionary != null) {
mUnigramDictionaries.put(DICT_KEY_CONTACTS, contactsDictionary);
mBigramDictionaries.put(DICT_KEY_CONTACTS, contactsDictionary);
+ } else {
+ mUnigramDictionaries.remove(DICT_KEY_CONTACTS);
+ mBigramDictionaries.remove(DICT_KEY_CONTACTS);
}
}