diff options
author | 2013-08-23 23:23:03 +0900 | |
---|---|---|
committer | 2013-08-26 16:14:59 +0900 | |
commit | bb5b84a82630bc2309c9ae866d43c7934768bb2e (patch) | |
tree | 6e1d699df1cfef116951745816b0353bcd02faab /java/src/com/android/inputmethod/latin/makedict/DictDecoder.java | |
parent | 800225e0b19c8a368fe74f6b73b40a01340a0c0f (diff) | |
download | latinime-bb5b84a82630bc2309c9ae866d43c7934768bb2e.tar.gz latinime-bb5b84a82630bc2309c9ae866d43c7934768bb2e.tar.xz latinime-bb5b84a82630bc2309c9ae866d43c7934768bb2e.zip |
[Refactor] Add DictDecoder.getTerminalPosition.
Change-Id: I9d04f64a58f5481cbb64cf1c09b5c485dd4176b4
Diffstat (limited to 'java/src/com/android/inputmethod/latin/makedict/DictDecoder.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/makedict/DictDecoder.java | 13 |
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; |