aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/BinaryDictionary.java
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2013-09-12 09:15:24 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-09-12 09:15:24 -0700
commit0d86a015be148723ccae0e88312a82a144ab96a6 (patch)
tree6841e478533d59c519d905792c430f5f4756828b /java/src/com/android/inputmethod/latin/BinaryDictionary.java
parent57ee1b7edad7728e204888d4062c67b8687f3e5e (diff)
parentb118a9d729b8ea58063a39396f60c7c5aa1c544b (diff)
downloadlatinime-0d86a015be148723ccae0e88312a82a144ab96a6.tar.gz
latinime-0d86a015be148723ccae0e88312a82a144ab96a6.tar.xz
latinime-0d86a015be148723ccae0e88312a82a144ab96a6.zip
am b118a9d7: Merge "Change cache capacity depending on the dictionary size."
* commit 'b118a9d729b8ea58063a39396f60c7c5aa1c544b': Change cache capacity depending on the dictionary size.
Diffstat (limited to 'java/src/com/android/inputmethod/latin/BinaryDictionary.java')
-rw-r--r--java/src/com/android/inputmethod/latin/BinaryDictionary.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java
index e8b06570f..834d3ed53 100644
--- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java
+++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java
@@ -43,6 +43,7 @@ public final class BinaryDictionary extends Dictionary {
private long mNativeDict;
private final Locale mLocale;
+ private final long mDictSize;
private final int[] mInputCodePoints = new int[MAX_WORD_LENGTH];
private final int[] mOutputCodePoints = new int[MAX_WORD_LENGTH * MAX_RESULTS];
private final int[] mSpaceIndices = new int[MAX_RESULTS];
@@ -62,7 +63,7 @@ public final class BinaryDictionary extends Dictionary {
if (traverseSession == null) {
traverseSession = mDicTraverseSessions.get(traverseSessionId);
if (traverseSession == null) {
- traverseSession = new DicTraverseSession(mLocale, mNativeDict);
+ traverseSession = new DicTraverseSession(mLocale, mNativeDict, mDictSize);
mDicTraverseSessions.put(traverseSessionId, traverseSession);
}
}
@@ -85,6 +86,7 @@ public final class BinaryDictionary extends Dictionary {
final boolean isUpdatable) {
super(dictType);
mLocale = locale;
+ mDictSize = length;
mNativeSuggestOptions.setUseFullEditDistance(useFullEditDistance);
loadDictionary(filename, offset, length, isUpdatable);
}