mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
fix findWordInTree.
Change-Id: I8f42df28f76188677db9d4e55885e1fc6a40b53f
This commit is contained in:
parent
66f338983b
commit
0d35c159fe
@ -532,6 +532,7 @@ public class FusionDictionary implements Iterable<Word> {
|
||||
} while (null != node && index < s.length());
|
||||
|
||||
if (index < s.length()) return null;
|
||||
if (!currentGroup.isTerminal()) return null;
|
||||
if (DBG && !s.equals(checker.toString())) return null;
|
||||
return currentGroup;
|
||||
}
|
||||
|
@ -38,5 +38,11 @@ public class FusionDictionaryTests extends AndroidTestCase {
|
||||
dict.add("aa", 10, null);
|
||||
assertNull(FusionDictionary.findWordInTree(dict.mRoot, "aaa"));
|
||||
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
Block a user