Skip to content
Snippets Groups Projects
Commit 9715cc4e authored by Jean Chalard's avatar Jean Chalard
Browse files

Fix a bug where the returned number of bigrams was incorrect

Bug: 6191885
Change-Id: I1daa4d2eaeec5f5c1a4eef79221fd7de357763e9
parent 6ca3ac08
No related branches found
No related tags found
No related merge requests found
......@@ -137,9 +137,10 @@ int BigramDictionary::getBigrams(unsigned short *prevWord, int prevWordLength, i
// 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);
if (addWordBigram(bigramBuffer, length, frequency)) {
++bigramCount;
}
}
++bigramCount;
} while (0 != (UnigramDictionary::FLAG_ATTRIBUTE_HAS_NEXT & bigramFlags));
return bigramCount;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment