diff options
author | 2013-08-23 04:32:36 -0700 | |
---|---|---|
committer | 2013-08-23 04:32:36 -0700 | |
commit | 6bdc19173f5e0c26766e2237dee105b512924605 (patch) | |
tree | d20317aa63f2768daa50756ab18a9957615ab65b /java/src/com/android/inputmethod/latin/personalization/DynamicPredictionDictionaryBase.java | |
parent | b6a70ead78177a913e777ca6ee9660ee7ca25bab (diff) | |
parent | e9a10ff0f026b5ec458f116afc7a75806574cbcd (diff) | |
download | latinime-6bdc19173f5e0c26766e2237dee105b512924605.tar.gz latinime-6bdc19173f5e0c26766e2237dee105b512924605.tar.xz latinime-6bdc19173f5e0c26766e2237dee105b512924605.zip |
am e9a10ff0: Add DictDecoder.readDictionaryBinary.
* commit 'e9a10ff0f026b5ec458f116afc7a75806574cbcd':
Add DictDecoder.readDictionaryBinary.
Diffstat (limited to 'java/src/com/android/inputmethod/latin/personalization/DynamicPredictionDictionaryBase.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/personalization/DynamicPredictionDictionaryBase.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/personalization/DynamicPredictionDictionaryBase.java b/java/src/com/android/inputmethod/latin/personalization/DynamicPredictionDictionaryBase.java index d046da850..d6456a3b9 100644 --- a/java/src/com/android/inputmethod/latin/personalization/DynamicPredictionDictionaryBase.java +++ b/java/src/com/android/inputmethod/latin/personalization/DynamicPredictionDictionaryBase.java @@ -28,6 +28,7 @@ import com.android.inputmethod.latin.ExpandableDictionary; import com.android.inputmethod.latin.LatinImeLogger; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; import com.android.inputmethod.latin.WordComposer; +import com.android.inputmethod.latin.makedict.DictDecoder; import com.android.inputmethod.latin.makedict.DictEncoder; import com.android.inputmethod.latin.makedict.FormatSpec.FormatOptions; import com.android.inputmethod.latin.makedict.Ver3DictDecoder; @@ -242,11 +243,12 @@ public abstract class DynamicPredictionDictionaryBase extends ExpandableDictiona }; // Load the dictionary from binary file - final Ver3DictDecoder reader = new Ver3DictDecoder( - new File(getContext().getFilesDir(), fileName)); + final File dictFile = new File(getContext().getFilesDir(), fileName); + final Ver3DictDecoder dictDecoder = new Ver3DictDecoder(dictFile, + DictDecoder.USE_BYTEARRAY); try { - reader.openDictBuffer(new Ver3DictDecoder.DictionaryBufferFromByteArrayFactory()); - UserHistoryDictIOUtils.readDictionaryBinary(reader, listener); + dictDecoder.openDictBuffer(); + UserHistoryDictIOUtils.readDictionaryBinary(dictDecoder, listener); } catch (FileNotFoundException e) { // This is an expected condition: we don't have a user history dictionary for this // language yet. It will be created sometime later. |