aboutsummaryrefslogtreecommitdiffstats
path: root/native/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-02-15 20:00:54 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-02-15 20:00:54 -0800
commit25ff89a75cb8b797bdaf0c7b78e50fd454c1b1e2 (patch)
treed19bbd65efba508b6f7c4bbd18354c5124891a9a /native/src
parenta252e0547f82e8c6778619465364328accab6353 (diff)
parentad290d6505247171e1e8437446c6f5d148a01778 (diff)
downloadlatinime-25ff89a75cb8b797bdaf0c7b78e50fd454c1b1e2.tar.gz
latinime-25ff89a75cb8b797bdaf0c7b78e50fd454c1b1e2.tar.xz
latinime-25ff89a75cb8b797bdaf0c7b78e50fd454c1b1e2.zip
Merge "Activate bigram predictions from the binary dictionary"
Diffstat (limited to 'native/src')
-rw-r--r--native/src/bigram_dictionary.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/native/src/bigram_dictionary.cpp b/native/src/bigram_dictionary.cpp
index db7734bc7..19b644679 100644
--- a/native/src/bigram_dictionary.cpp
+++ b/native/src/bigram_dictionary.cpp
@@ -134,7 +134,8 @@ int BigramDictionary::getBigrams(unsigned short *prevWord, int prevWordLength, i
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);
}