aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-10-18 08:00:04 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-10-18 08:00:04 +0000
commit7e7fe6057a61bd5d35529f19a2537e37f612ad31 (patch)
treec5d0a12b832780270afae256199115fc77893a8f /java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java
parenta62dc28121d72978d527eec2791d1caf43b563b8 (diff)
parent520f612849fcf6909e83b9d82b91b01d44039488 (diff)
downloadlatinime-7e7fe6057a61bd5d35529f19a2537e37f612ad31.tar.gz
latinime-7e7fe6057a61bd5d35529f19a2537e37f612ad31.tar.xz
latinime-7e7fe6057a61bd5d35529f19a2537e37f612ad31.zip
Merge "(1/2) Implement insertWord in Ver4DictUpdater."
Diffstat (limited to 'java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java')
-rw-r--r--java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java23
1 files changed, 14 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java b/java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java
index add03c323..ae344a2cd 100644
--- a/java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java
+++ b/java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java
@@ -40,17 +40,17 @@ import java.util.Arrays;
public class Ver4DictDecoder extends AbstractDictDecoder {
private static final String TAG = Ver4DictDecoder.class.getSimpleName();
- private static final int FILETYPE_TRIE = 1;
- private static final int FILETYPE_FREQUENCY = 2;
- private static final int FILETYPE_TERMINAL_ADDRESS_TABLE = 3;
- private static final int FILETYPE_BIGRAM_FREQ = 4;
- private static final int FILETYPE_SHORTCUT = 5;
+ protected static final int FILETYPE_TRIE = 1;
+ protected static final int FILETYPE_FREQUENCY = 2;
+ protected static final int FILETYPE_TERMINAL_ADDRESS_TABLE = 3;
+ protected static final int FILETYPE_BIGRAM_FREQ = 4;
+ protected static final int FILETYPE_SHORTCUT = 5;
private final File mDictDirectory;
- private final DictionaryBufferFactory mBufferFactory;
+ protected final DictionaryBufferFactory mBufferFactory;
protected DictBuffer mDictBuffer;
- private DictBuffer mFrequencyBuffer;
- private DictBuffer mTerminalAddressTableBuffer;
+ protected DictBuffer mFrequencyBuffer;
+ protected DictBuffer mTerminalAddressTableBuffer;
private BigramContentReader mBigramReader;
private ShortcutContentReader mShortcutReader;
@@ -64,6 +64,8 @@ public class Ver4DictDecoder extends AbstractDictDecoder {
public final int mChildrenPos;
public final int mParentPos;
public final int mNodeSize;
+ public int mStartIndexOfCharacters;
+ public int mEndIndexOfCharacters; // exclusive
public Ver4PtNodeInfo(final int flags, final int[] characters, final int terminalId,
final int childrenPos, final int parentPos, final int nodeSize) {
@@ -73,6 +75,8 @@ public class Ver4DictDecoder extends AbstractDictDecoder {
mChildrenPos = childrenPos;
mParentPos = parentPos;
mNodeSize = nodeSize;
+ mStartIndexOfCharacters = 0;
+ mEndIndexOfCharacters = characters.length;
}
}
@@ -99,7 +103,7 @@ public class Ver4DictDecoder extends AbstractDictDecoder {
mDictBuffer = mFrequencyBuffer = null;
}
- private File getFile(final int fileType) {
+ protected File getFile(final int fileType) {
if (fileType == FILETYPE_TRIE) {
return new File(mDictDirectory,
mDictDirectory.getName() + FormatSpec.TRIE_FILE_EXTENSION);
@@ -141,6 +145,7 @@ public class Ver4DictDecoder extends AbstractDictDecoder {
return mDictBuffer != null;
}
+ @UsedForTesting
/* package */ DictBuffer getDictBuffer() {
return mDictBuffer;
}