diff options
author | 2010-06-02 18:30:27 +0900 | |
---|---|---|
committer | 2010-06-02 19:18:22 +0900 | |
commit | 4ee3676cf38f3f9b2587f37e259b6d7511ef4ab1 (patch) | |
tree | 39acf8d13039453bb57c0aeaecaeaab26df0522a /java/src/com/android/inputmethod/latin/ExpandableDictionary.java | |
parent | 7f96616c7595c69ea6ce9192d869a0c40ddb752e (diff) | |
download | latinime-4ee3676cf38f3f9b2587f37e259b6d7511ef4ab1.tar.gz latinime-4ee3676cf38f3f9b2587f37e259b6d7511ef4ab1.tar.xz latinime-4ee3676cf38f3f9b2587f37e259b6d7511ef4ab1.zip |
Check suggested words whether they are from mainDic or not
- Added counters for suggestions by dictionarys
- Added a counter for cancelled suggestions
Change-Id: Ia7d3a73855b1e82b60a010f18dba4e1c0fe1c2bb
Diffstat (limited to 'java/src/com/android/inputmethod/latin/ExpandableDictionary.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/ExpandableDictionary.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/java/src/com/android/inputmethod/latin/ExpandableDictionary.java b/java/src/com/android/inputmethod/latin/ExpandableDictionary.java index 46bc41c42..e2a812796 100644 --- a/java/src/com/android/inputmethod/latin/ExpandableDictionary.java +++ b/java/src/com/android/inputmethod/latin/ExpandableDictionary.java @@ -16,11 +16,8 @@ package com.android.inputmethod.latin; -import com.android.inputmethod.latin.Dictionary.WordCallback; - import android.content.Context; import android.os.AsyncTask; -import android.os.SystemClock; /** * Base class for an in-memory dictionary that can grow dynamically and can @@ -29,6 +26,7 @@ import android.os.SystemClock; public class ExpandableDictionary extends Dictionary { private Context mContext; private char[] mWordBuilder = new char[MAX_WORD_LENGTH]; + private int mDicTypeId; private int mMaxDepth; private int mInputLength; private int[] mNextLettersFrequencies; @@ -75,10 +73,11 @@ public class ExpandableDictionary extends Dictionary { private int[][] mCodes; - ExpandableDictionary(Context context) { + ExpandableDictionary(Context context, int dicTypeId) { mContext = context; clearDictionary(); mCodes = new int[MAX_WORD_LENGTH][]; + mDicTypeId = dicTypeId; } public void loadDictionary() { @@ -267,7 +266,7 @@ public class ExpandableDictionary extends Dictionary { if (completion) { word[depth] = c; if (terminal) { - if (!callback.addWord(word, 0, depth + 1, freq * snr)) { + if (!callback.addWord(word, 0, depth + 1, freq * snr, mDicTypeId)) { return; } // Add to frequency of next letters for predictive correction @@ -305,7 +304,7 @@ public class ExpandableDictionary extends Dictionary { || !same(word, depth + 1, codes.getTypedWord())) { int finalFreq = freq * snr * addedAttenuation; if (skipPos < 0) finalFreq *= FULL_WORD_FREQ_MULTIPLIER; - callback.addWord(word, 0, depth + 1, finalFreq); + callback.addWord(word, 0, depth + 1, finalFreq, mDicTypeId); } } if (children != null) { |