Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check key conflict #8

Open
jinxing3114 opened this issue Oct 31, 2020 · 0 comments
Open

check key conflict #8

jinxing3114 opened this issue Oct 31, 2020 · 0 comments

Comments

@jinxing3114
Copy link

If the last two characters of the first string in the list are consecutive coding, then only the last character can be queried to return the correct result, which is different from the expected.

Code example:
//list add 123 or 234 or 345
//key = 3 or 4 or 5
//The results are all matchable
DoubleArrayTrie adt = new DoubleArrayTrie();
List list = new ArrayList();
list.add("123");
// 所有词必须先排序
Collections.sort(list);
// 构建DoubleArrayTrie
adt.build(list);
String key = "3";
// 检索key是否完全命中了词典中的某个词
int index = adt.exactMatchSearch(key);
System.out.println(index)
//print result 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant