Fix a bug where a bigram would be ignored

Bug: 7403386
Change-Id: I89f495d07f7059a9f1ccd97d487c2f2657a8ebd2
main
Jean Chalard 2012-10-24 13:24:59 +09:00
parent 1ec8299389
commit ddb0bcc051
1 changed files with 4 additions and 0 deletions

View File

@ -358,6 +358,10 @@ public final class FusionDictionary implements Iterable<Word> {
if (charGroup2 == null) { if (charGroup2 == null) {
add(getCodePoints(word2), 0, null, false /* isNotAWord */, add(getCodePoints(word2), 0, null, false /* isNotAWord */,
false /* isBlacklistEntry */); false /* isBlacklistEntry */);
// The chargroup for the first word may have moved by the above insertion,
// if word1 and word2 share a common stem that happens not to have been
// a cutting point until now. In this case, we need to refresh charGroup.
charGroup = findWordInTree(mRoot, word1);
} }
charGroup.addBigram(word2, frequency); charGroup.addBigram(word2, frequency);
} else { } else {