From ddb0bcc051c1e9f2706f3702f0bb3135e4352f7b Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Wed, 24 Oct 2012 13:24:59 +0900 Subject: [PATCH] Fix a bug where a bigram would be ignored Bug: 7403386 Change-Id: I89f495d07f7059a9f1ccd97d487c2f2657a8ebd2 --- .../android/inputmethod/latin/makedict/FusionDictionary.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java b/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java index 6f1faa192..7fd13d78b 100644 --- a/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java +++ b/java/src/com/android/inputmethod/latin/makedict/FusionDictionary.java @@ -358,6 +358,10 @@ public final class FusionDictionary implements Iterable { if (charGroup2 == null) { add(getCodePoints(word2), 0, null, false /* isNotAWord */, 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); } else {