aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/Dictionary.java
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2014-06-09 11:04:28 +0900
committerKeisuke Kuroyanagi <ksk@google.com>2014-06-09 11:04:28 +0900
commit1910392eeddf2c9f4c1d34925e64f8d8772e7dc4 (patch)
treecb7f0fd78beeacea2edd9e059f5f88606b08f7e4 /java/src/com/android/inputmethod/latin/Dictionary.java
parent166d8c2293eee268c62ecfba65d2d89d35d97540 (diff)
downloadlatinime-1910392eeddf2c9f4c1d34925e64f8d8772e7dc4.tar.gz
latinime-1910392eeddf2c9f4c1d34925e64f8d8772e7dc4.tar.xz
latinime-1910392eeddf2c9f4c1d34925e64f8d8772e7dc4.zip
Add Dictionary.isInDictionary().
Bug: 13142176 Bug: 15428247 Change-Id: If2d1c1fea7a69e41809a828da8dd032211ad144e
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Dictionary.java')
-rw-r--r--java/src/com/android/inputmethod/latin/Dictionary.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/Dictionary.java b/java/src/com/android/inputmethod/latin/Dictionary.java
index bc7276b9a..b55ed125f 100644
--- a/java/src/com/android/inputmethod/latin/Dictionary.java
+++ b/java/src/com/android/inputmethod/latin/Dictionary.java
@@ -16,6 +16,7 @@
package com.android.inputmethod.latin;
+import com.android.inputmethod.annotations.UsedForTesting;
import com.android.inputmethod.keyboard.ProximityInfo;
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
@@ -85,11 +86,19 @@ public abstract class Dictionary {
final int sessionId, final float[] inOutLanguageWeight);
/**
- * Checks if the given word occurs in the dictionary
+ * Checks if the given word has to be treated as a valid word. Please note that some
+ * dictionaries have entries that should be treated as invalid words.
* @param word the word to search for. The search should be case-insensitive.
- * @return true if the word exists, false otherwise
+ * @return true if the word is valid, false otherwise
*/
- abstract public boolean isValidWord(final String word);
+ public boolean isValidWord(final String word) {
+ return isInDictionary(word);
+ }
+
+ /**
+ * Checks if the given word is in the dictionary regardless of it being valid or not.
+ */
+ abstract public boolean isInDictionary(final String word);
public int getFrequency(final String word) {
return NOT_A_PROBABILITY;
@@ -165,7 +174,7 @@ public abstract class Dictionary {
}
@Override
- public boolean isValidWord(String word) {
+ public boolean isInDictionary(String word) {
return false;
}
}