aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/makedict/DictDecoder.java
diff options
context:
space:
mode:
authorKen Wakasa <kwakasa@google.com>2013-08-26 00:47:12 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-08-26 00:47:12 -0700
commitddb3a08f0b2fbff609fbfe1d7ccad7167f5ea1f0 (patch)
tree741c33f7de9e12b6a497851bd48a1a846e734f09 /java/src/com/android/inputmethod/latin/makedict/DictDecoder.java
parent1c21bb82b44659c9ed0d1dae39e57636da116419 (diff)
parent918336b7e790e108c109457e89c07f4dab5309c0 (diff)
downloadlatinime-ddb3a08f0b2fbff609fbfe1d7ccad7167f5ea1f0.tar.gz
latinime-ddb3a08f0b2fbff609fbfe1d7ccad7167f5ea1f0.tar.xz
latinime-ddb3a08f0b2fbff609fbfe1d7ccad7167f5ea1f0.zip
am 918336b7: Merge "[Refactor] Add DictDecoder.getTerminalPosition."
* commit '918336b7e790e108c109457e89c07f4dab5309c0': [Refactor] Add DictDecoder.getTerminalPosition.
Diffstat (limited to 'java/src/com/android/inputmethod/latin/makedict/DictDecoder.java')
-rw-r--r--java/src/com/android/inputmethod/latin/makedict/DictDecoder.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/makedict/DictDecoder.java b/java/src/com/android/inputmethod/latin/makedict/DictDecoder.java
index 5be506999..d5fcacc09 100644
--- a/java/src/com/android/inputmethod/latin/makedict/DictDecoder.java
+++ b/java/src/com/android/inputmethod/latin/makedict/DictDecoder.java
@@ -58,6 +58,19 @@ public interface DictDecoder {
public FusionDictionary readDictionaryBinary(final FusionDictionary dict)
throws FileNotFoundException, IOException, UnsupportedFormatException;
+ /**
+ * Gets the address of the last PtNode of the exact matching word in the dictionary.
+ * If no match is found, returns NOT_VALID_WORD.
+ *
+ * @param word the word we search for.
+ * @return the address of the terminal node.
+ * @throws IOException if the file can't be read.
+ * @throws UnsupportedFormatException if the format of the file is not recognized.
+ */
+ @UsedForTesting
+ public int getTerminalPosition(final String word)
+ throws IOException, UnsupportedFormatException;
+
// Flags for DictionaryBufferFactory.
public static final int USE_READONLY_BYTEBUFFER = 0x01000000;
public static final int USE_BYTEARRAY = 0x02000000;