aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/DictionaryFacilitator.java
diff options
context:
space:
mode:
authorDan Zivkovic <zivkovic@google.com>2015-04-28 18:46:17 -0700
committerDan Zivkovic <zivkovic@google.com>2015-04-29 14:30:49 -0700
commit459b4f353e6138b644c1f06de68e93532ee0d856 (patch)
treeaf614b878e10b2af9513dbbdec0816bb498e8102 /java/src/com/android/inputmethod/latin/DictionaryFacilitator.java
parent82bf4a6aee0c00cf4dd17dcdf15682b20dd1d911 (diff)
downloadlatinime-459b4f353e6138b644c1f06de68e93532ee0d856.tar.gz
latinime-459b4f353e6138b644c1f06de68e93532ee0d856.tar.xz
latinime-459b4f353e6138b644c1f06de68e93532ee0d856.zip
Spelling cannot cache words across invocations.
We want to let the facilitator decide if a word is valid or invalid, and cache the answer in the facilitator's cache. The spell checker session doesn't need its own word cache, except as a crutch to communicate suggestions to the code that populates the suggestion drop-down. We leave that in place. Bug 20018546. Change-Id: I3c3c53e0c1d709fa2f64a2952a232acd7380b57a
Diffstat (limited to 'java/src/com/android/inputmethod/latin/DictionaryFacilitator.java')
-rw-r--r--java/src/com/android/inputmethod/latin/DictionaryFacilitator.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/DictionaryFacilitator.java b/java/src/com/android/inputmethod/latin/DictionaryFacilitator.java
index ff798abd6..9d8bdb2d1 100644
--- a/java/src/com/android/inputmethod/latin/DictionaryFacilitator.java
+++ b/java/src/com/android/inputmethod/latin/DictionaryFacilitator.java
@@ -17,6 +17,7 @@
package com.android.inputmethod.latin;
import android.content.Context;
+import android.util.LruCache;
import com.android.inputmethod.annotations.UsedForTesting;
import com.android.inputmethod.keyboard.Keyboard;
@@ -55,6 +56,18 @@ public interface DictionaryFacilitator {
Dictionary.TYPE_USER};
/**
+ * The facilitator will put words into the cache whenever it decodes them.
+ * @param cache
+ */
+ void setValidSpellingWordReadCache(final LruCache<String, Boolean> cache);
+
+ /**
+ * The facilitator will get words from the cache whenever it needs to check their spelling.
+ * @param cache
+ */
+ void setValidSpellingWordWriteCache(final LruCache<String, Boolean> cache);
+
+ /**
* Returns whether this facilitator is exactly for this locale.
*
* @param locale the locale to test against