aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java
diff options
context:
space:
mode:
authorAkifumi Yoshimoto <akifumi@google.com>2014-10-02 08:55:18 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-10-02 08:55:18 +0000
commit7e5614520a581afa79a51677e973a9ff6dc29162 (patch)
treec25f5df268181fa1898d5fef1fa3d29cd324d0f7 /tests/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java
parent1a7da2ec49547423d5071a8fd5b45dcd949ec332 (diff)
parent9168ab60cf08385554a7a8255e40698988ee37f6 (diff)
downloadlatinime-7e5614520a581afa79a51677e973a9ff6dc29162.tar.gz
latinime-7e5614520a581afa79a51677e973a9ff6dc29162.tar.xz
latinime-7e5614520a581afa79a51677e973a9ff6dc29162.zip
Merge "Include a code point table in the binary dictionary."
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java')
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java b/tests/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java
index 18f4bcf5f..6227f13e1 100644
--- a/tests/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java
@@ -177,7 +177,8 @@ public class Ver2DictDecoder extends AbstractDictDecoder {
if (header == null) {
throw new IOException("Cannot read the dictionary header.");
}
- if (header.mFormatOptions.mVersion != FormatSpec.VERSION2) {
+ if (header.mFormatOptions.mVersion != FormatSpec.VERSION2 &&
+ header.mFormatOptions.mVersion != FormatSpec.VERSION201) {
throw new UnsupportedFormatException("File header has a wrong version : "
+ header.mFormatOptions.mVersion);
}
@@ -200,19 +201,19 @@ public class Ver2DictDecoder extends AbstractDictDecoder {
if (0 != (flags & FormatSpec.FLAG_HAS_MULTIPLE_CHARS)) {
int index = 0;
int character = CharEncoding.readChar(mDictBuffer);
- addressPointer += CharEncoding.getCharSize(character);
+ addressPointer += CharEncoding.getCharSize(character, null);
while (FormatSpec.INVALID_CHARACTER != character) {
// FusionDictionary is making sure that the length of the word is smaller than
// MAX_WORD_LENGTH.
// So we'll never write past the end of mCharacterBuffer.
mCharacterBuffer[index++] = character;
character = CharEncoding.readChar(mDictBuffer);
- addressPointer += CharEncoding.getCharSize(character);
+ addressPointer += CharEncoding.getCharSize(character, null);
}
characters = Arrays.copyOfRange(mCharacterBuffer, 0, index);
} else {
final int character = CharEncoding.readChar(mDictBuffer);
- addressPointer += CharEncoding.getCharSize(character);
+ addressPointer += CharEncoding.getCharSize(character, null);
characters = new int[] { character };
}
final ProbabilityInfo probabilityInfo;