aboutsummaryrefslogtreecommitdiffstats
path: root/native/src/dictionary.cpp
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2011-06-17 12:45:17 +0900
committerThe Android Automerger <android-build@android.com>2011-06-17 06:49:12 -0700
commit46b26d9ff6f3e071b17003f024669fe037ec00b6 (patch)
tree416a4142f34c7e819cec1b6ed99665ed4f1fac50 /native/src/dictionary.cpp
parent17e44a72e846d1514c5b2b4d0ad80e3fbbf26fdd (diff)
downloadlatinime-46b26d9ff6f3e071b17003f024669fe037ec00b6.tar.gz
latinime-46b26d9ff6f3e071b17003f024669fe037ec00b6.tar.xz
latinime-46b26d9ff6f3e071b17003f024669fe037ec00b6.zip
Fix a bug where bigram search would never return
Bug: 4690487 Change-Id: Ie8f3f651508cc48bbb043a0b308f7e0d1524371c
Diffstat (limited to 'native/src/dictionary.cpp')
-rw-r--r--native/src/dictionary.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/native/src/dictionary.cpp b/native/src/dictionary.cpp
index a49769bdb..9e32ee80f 100644
--- a/native/src/dictionary.cpp
+++ b/native/src/dictionary.cpp
@@ -57,4 +57,12 @@ bool Dictionary::isValidWord(unsigned short *word, int length) {
return mUnigramDictionary->isValidWord(word, length);
}
+int Dictionary::getBigramPosition(unsigned short *word, int length) {
+ if (IS_LATEST_DICT_VERSION) {
+ return mUnigramDictionary->getBigramPosition(DICTIONARY_HEADER_SIZE, word, 0, length);
+ } else {
+ return mUnigramDictionary->getBigramPosition(0, word, 0, length);
+ }
+}
+
} // namespace latinime