diff options
author | 2010-06-30 20:28:04 -0700 | |
---|---|---|
committer | 2010-07-13 11:33:39 -0700 | |
commit | 937d5ad0131267aa4273f3e5d75b203a1f263c18 (patch) | |
tree | b4a3bb6206aea92f5bacc3ebc1387ffdd5916f0c /java/src/com/android/inputmethod/latin/ExpandableDictionary.java | |
parent | b71547f2d065a17b268d1dbc896daab1820141a6 (diff) | |
download | latinime-937d5ad0131267aa4273f3e5d75b203a1f263c18.tar.gz latinime-937d5ad0131267aa4273f3e5d75b203a1f263c18.tar.xz latinime-937d5ad0131267aa4273f3e5d75b203a1f263c18.zip |
added bigram prediction
- after first character, only suggests bigram data (but doesn't autocomplete)
- after second character, words from dictionary gets rearranged by using bigram
- compatible with old dictionary
- added preference option to disable bigram
Change-Id: Ia8f4e8fa55e797e86d858fd499887cd396388411
Diffstat (limited to 'java/src/com/android/inputmethod/latin/ExpandableDictionary.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/ExpandableDictionary.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/ExpandableDictionary.java b/java/src/com/android/inputmethod/latin/ExpandableDictionary.java index 46bc41c42..6f4d925ee 100644 --- a/java/src/com/android/inputmethod/latin/ExpandableDictionary.java +++ b/java/src/com/android/inputmethod/latin/ExpandableDictionary.java @@ -267,7 +267,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, DataType.UNIGRAM)) { return; } // Add to frequency of next letters for predictive correction @@ -305,7 +305,8 @@ 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, + DataType.UNIGRAM); } } if (children != null) { |