Activate bigram predictions from the binary dictionary
Change-Id: If1cc50539d7677b854b1cd3bea3423c8c0865de5
diff --git a/native/src/bigram_dictionary.cpp b/native/src/bigram_dictionary.cpp
index db7734b..19b6446 100644
--- a/native/src/bigram_dictionary.cpp
+++ b/native/src/bigram_dictionary.cpp
@@ -134,7 +134,8 @@
const int length = BinaryFormat::getWordAtAddress(root, bigramPos, MAX_WORD_LENGTH,
bigramBuffer);
- if (checkFirstCharacter(bigramBuffer)) {
+ // codesSize == 0 means we are trying to find bigram predictions.
+ if (codesSize < 1 || checkFirstCharacter(bigramBuffer)) {
const int frequency = UnigramDictionary::MASK_ATTRIBUTE_FREQUENCY & bigramFlags;
addWordBigram(bigramBuffer, length, frequency);
}