am 7145ca71: am 228674f6: Merge "fix findWordInTree." into jb-mr1-dev
* commit '7145ca713854d090eb5c3ceeb588748f575764e3': fix findWordInTree.main
commit
bab6c021bd
|
@ -532,6 +532,7 @@ public class FusionDictionary implements Iterable<Word> {
|
||||||
} while (null != node && index < s.length());
|
} while (null != node && index < s.length());
|
||||||
|
|
||||||
if (index < s.length()) return null;
|
if (index < s.length()) return null;
|
||||||
|
if (!currentGroup.isTerminal()) return null;
|
||||||
if (DBG && !s.equals(checker.toString())) return null;
|
if (DBG && !s.equals(checker.toString())) return null;
|
||||||
return currentGroup;
|
return currentGroup;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,5 +38,11 @@ public class FusionDictionaryTests extends AndroidTestCase {
|
||||||
dict.add("aa", 10, null);
|
dict.add("aa", 10, null);
|
||||||
assertNull(FusionDictionary.findWordInTree(dict.mRoot, "aaa"));
|
assertNull(FusionDictionary.findWordInTree(dict.mRoot, "aaa"));
|
||||||
assertNotNull(FusionDictionary.findWordInTree(dict.mRoot, "aa"));
|
assertNotNull(FusionDictionary.findWordInTree(dict.mRoot, "aa"));
|
||||||
|
|
||||||
|
dict.add("babcd", 10, null);
|
||||||
|
dict.add("bacde", 10, null);
|
||||||
|
assertNull(FusionDictionary.findWordInTree(dict.mRoot, "ba"));
|
||||||
|
assertNotNull(FusionDictionary.findWordInTree(dict.mRoot, "babcd"));
|
||||||
|
assertNotNull(FusionDictionary.findWordInTree(dict.mRoot, "bacde"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue