aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java
diff options
context:
space:
mode:
authorYuichiro Hanada <yhanada@google.com>2012-08-16 18:40:14 +0900
committerYuichiro Hanada <yhanada@google.com>2012-08-31 15:08:57 +0900
commit666a4338026866df1f18dd6b3f968c3788943e4c (patch)
treef960c4683032798e88d6f4e289820becdf8a41d1 /java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java
parent9bbc7ec052e3cb0a575fd56e5d8ddbc172841f6e (diff)
downloadlatinime-666a4338026866df1f18dd6b3f968c3788943e4c.tar.gz
latinime-666a4338026866df1f18dd6b3f968c3788943e4c.tar.xz
latinime-666a4338026866df1f18dd6b3f968c3788943e4c.zip
add UserHistoryDictIOUtils.
Change-Id: I8a70e43b23f65b5fd5f0ee0b30a94ad8f5ef8a8a
Diffstat (limited to 'java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java')
-rw-r--r--java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java13
1 files changed, 2 insertions, 11 deletions
diff --git a/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java b/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java
index 9f7f41331..bb7d1b2d2 100644
--- a/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java
+++ b/java/src/com/android/inputmethod/latin/makedict/BinaryDictInputOutput.java
@@ -189,7 +189,7 @@ public class BinaryDictInputOutput {
// suspicion that a bug might be causing an infinite loop.
private static final int MAX_PASSES = 24;
- private interface FusionDictionaryBufferInterface {
+ public interface FusionDictionaryBufferInterface {
public int readUnsignedByte();
public int readUnsignedShort();
public int readUnsignedInt24();
@@ -234,7 +234,6 @@ public class BinaryDictInputOutput {
@Override
public void position(int newPos) {
mBuffer.position(newPos);
- return;
}
}
@@ -1393,7 +1392,6 @@ public class BinaryDictInputOutput {
final FusionDictionaryBufferInterface buffer, final int headerSize,
final Map<Integer, String> words, final Map<Integer, Integer> frequencies,
final Map<Integer, ArrayList<PendingAttribute>> bigrams) {
-
int[] pushedChars = new int[MAX_WORD_LENGTH + 1];
Stack<Position> stack = new Stack<Position>();
@@ -1443,8 +1441,6 @@ public class BinaryDictInputOutput {
stack.push(childrenPos);
}
}
-
- return;
}
/**
@@ -1462,7 +1458,6 @@ public class BinaryDictInputOutput {
final Map<Integer, String> words, final Map<Integer, Integer> frequencies,
final Map<Integer, ArrayList<PendingAttribute>> bigrams) throws IOException,
UnsupportedFormatException {
-
// Read header
final int version = checkFormatVersion(buffer);
final int optionsFlags = buffer.readUnsignedShort();
@@ -1507,10 +1502,8 @@ public class BinaryDictInputOutput {
* @throws UnsupportedFormatException
*/
private static int readHeader(final FusionDictionaryBufferInterface buffer,
- final HashMap<String, String> options,
- final int version)
+ final HashMap<String, String> options, final int version)
throws IOException, UnsupportedFormatException {
-
final int headerSize;
if (version < FIRST_VERSION_WITH_HEADER_SIZE) {
headerSize = buffer.position();
@@ -1523,7 +1516,6 @@ public class BinaryDictInputOutput {
if (headerSize < 0) {
throw new UnsupportedFormatException("header size can't be negative.");
}
-
return headerSize;
}
@@ -1561,7 +1553,6 @@ public class BinaryDictInputOutput {
public static FusionDictionary readDictionaryBinary(
final FusionDictionaryBufferInterface buffer, final FusionDictionary dict)
throws IOException, UnsupportedFormatException {
-
// clear cache
wordCache.clear();