diff options
author | 2014-09-10 18:33:24 +0900 | |
---|---|---|
committer | 2014-10-02 12:27:49 +0900 | |
commit | 9168ab60cf08385554a7a8255e40698988ee37f6 (patch) | |
tree | 8adddd41e28e7a854795b4c0727c58ec23a212c1 /tests/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java | |
parent | 0c2cdcc7350e8dc0e97f0aa4f343984f3cf39f72 (diff) | |
download | latinime-9168ab60cf08385554a7a8255e40698988ee37f6.tar.gz latinime-9168ab60cf08385554a7a8255e40698988ee37f6.tar.xz latinime-9168ab60cf08385554a7a8255e40698988ee37f6.zip |
Include a code point table in the binary dictionary.
Bug:17097992
Change-Id: I677a5eb3a704e4386f6573360e44ca335d81d2df
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/makedict/Ver2DictDecoder.java | 9 |
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 65b84d5f7..6fd0203a3 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; |