diff options
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/BinaryDictionary.java | 1 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/DicTraverseSession.java | 14 |
2 files changed, 8 insertions, 7 deletions
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java index 6ac6e83a3..7ba565c31 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java @@ -98,6 +98,7 @@ public class BinaryDictionary extends Dictionary { private static native float calcNormalizedScoreNative(char[] before, char[] after, int score); private static native int editDistanceNative(char[] before, char[] after); + // TODO: Move native dict into session private final void loadDictionary(String path, long startOffset, long length) { mNativeDict = openNative(path, startOffset, length, TYPED_LETTER_MULTIPLIER, FULL_WORD_SCORE_MULTIPLIER, MAX_WORD_LENGTH, MAX_WORDS, MAX_PREDICTIONS); diff --git a/java/src/com/android/inputmethod/latin/DicTraverseSession.java b/java/src/com/android/inputmethod/latin/DicTraverseSession.java index 437876e05..160752896 100644 --- a/java/src/com/android/inputmethod/latin/DicTraverseSession.java +++ b/java/src/com/android/inputmethod/latin/DicTraverseSession.java @@ -23,8 +23,8 @@ public class DicTraverseSession { JniUtils.loadNativeLibrary(); } private native long setDicTraverseSessionNative(String locale); - private native void initDicTraverseSessionNative( - long nativeDicTraverseSession, int[] previousWord, int previwousWordLength); + private native void initDicTraverseSessionNative(long nativeDicTraverseSession, + long dictionary, int[] previousWord, int previwousWordLength); private native void releaseDicTraverseSessionNative(long nativeDicTraverseSession); private long mNativeDicTraverseSession; @@ -32,19 +32,19 @@ public class DicTraverseSession { public DicTraverseSession(Locale locale) { mNativeDicTraverseSession = createNativeDicTraverseSession( locale != null ? locale.toString() : ""); - initSession(); } public long getSession() { return mNativeDicTraverseSession; } - public void initSession() { - initSession(null, 0); + public void initSession(long dictionary) { + initSession(dictionary, null, 0); } - public void initSession(int[] previousWord, int previousWordLength) { - initDicTraverseSessionNative(mNativeDicTraverseSession, previousWord, previousWordLength); + public void initSession(long dictionary, int[] previousWord, int previousWordLength) { + initDicTraverseSessionNative( + mNativeDicTraverseSession, dictionary, previousWord, previousWordLength); } private final long createNativeDicTraverseSession(String locale) { |