aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java
diff options
context:
space:
mode:
authorYuichiro Hanada <yhanada@google.com>2013-08-20 21:05:05 +0900
committerYuichiro Hanada <yhanada@google.com>2013-09-19 16:11:23 +0900
commit14087ba52c6b5b7acd25ee4a1ef1663ceb72bbf4 (patch)
treee9fa7000d96c1e67390092d90179ffc03f827282 /java/src/com/android/inputmethod/latin/makedict/FormatSpec.java
parent926ee64bc40c45ed0e131003ea8f9fa3d26abc82 (diff)
downloadlatinime-14087ba52c6b5b7acd25ee4a1ef1663ceb72bbf4.tar.gz
latinime-14087ba52c6b5b7acd25ee4a1ef1663ceb72bbf4.tar.xz
latinime-14087ba52c6b5b7acd25ee4a1ef1663ceb72bbf4.zip
Add Ver4DictDecoder.
Bug: 9618601 Change-Id: I43c5840505c6a847aaf4893a400392ccd45903c0
Diffstat (limited to 'java/src/com/android/inputmethod/latin/makedict/FormatSpec.java')
-rw-r--r--java/src/com/android/inputmethod/latin/makedict/FormatSpec.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java b/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java
index 96ccd8e49..51b89a02a 100644
--- a/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java
+++ b/java/src/com/android/inputmethod/latin/makedict/FormatSpec.java
@@ -360,18 +360,26 @@ public final class FormatSpec {
* Returns new dictionary decoder.
*
* @param dictFile the dictionary file.
- * @param bufferType the flag indicating buffer type which is used by the dictionary decoder.
+ * @param bufferType The type of buffer, as one of USE_* in DictDecoder.
* @return new dictionary decoder if the dictionary file exists, otherwise null.
*/
public static DictDecoder getDictDecoder(final File dictFile, final int bufferType) {
- if (!dictFile.isFile()) return null;
- return new Ver3DictDecoder(dictFile, bufferType);
+ if (dictFile.isDirectory()) {
+ return new Ver4DictDecoder(dictFile, bufferType);
+ } else if (dictFile.isFile()) {
+ return new Ver3DictDecoder(dictFile, bufferType);
+ }
+ return null;
}
public static DictDecoder getDictDecoder(final File dictFile,
final DictionaryBufferFactory factory) {
- if (!dictFile.isFile()) return null;
- return new Ver3DictDecoder(dictFile, factory);
+ if (dictFile.isDirectory()) {
+ return new Ver4DictDecoder(dictFile, factory);
+ } else if (dictFile.isFile()) {
+ return new Ver3DictDecoder(dictFile, factory);
+ }
+ return null;
}
public static DictDecoder getDictDecoder(final File dictFile) {