diff options
author | 2014-06-09 02:40:38 +0000 | |
---|---|---|
committer | 2014-06-09 02:40:39 +0000 | |
commit | 79e2e9fa8c08ea1ad1b1e51f83bdd28fa88660dd (patch) | |
tree | dc8e0235ebf6b5f326a9d7a87a9ff61029e80dd0 /java/src/com/android/inputmethod/latin/Dictionary.java | |
parent | dec599d1723f4ff52f066bd2dd1a4457d30cd33c (diff) | |
parent | 1910392eeddf2c9f4c1d34925e64f8d8772e7dc4 (diff) | |
download | latinime-79e2e9fa8c08ea1ad1b1e51f83bdd28fa88660dd.tar.gz latinime-79e2e9fa8c08ea1ad1b1e51f83bdd28fa88660dd.tar.xz latinime-79e2e9fa8c08ea1ad1b1e51f83bdd28fa88660dd.zip |
Merge "Add Dictionary.isInDictionary()."
Diffstat (limited to 'java/src/com/android/inputmethod/latin/Dictionary.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/Dictionary.java | 17 |
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; } } |