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

关于字典树的正向最大实体搜索 #22

Open
qingyujean opened this issue Sep 23, 2021 · 1 comment
Open

关于字典树的正向最大实体搜索 #22

qingyujean opened this issue Sep 23, 2021 · 1 comment

Comments

@qingyujean
Copy link

qingyujean commented Sep 23, 2021

代码中正向最大实体搜索search_entity似乎有点问题,例如:

trie_obj = Trie()
en_lst = ["大话", "大话英雄"] # 假设树就这2个节点

for en in en_lst:
    trie_obj.insert(en)

# text = "大话英雄"  # 会输出【大话英雄】
# text = "大话" # 会输出【大话】
text = "大话英熊" # 程序不会输出预想的【大话】

match_lst = trie_obj.search_entity(text)
print(match_lst)

当text为"大话英熊"时我想应该要识别出【大话】这个实体,但是程序没有,请问这是一个bug吗,还是作者故意这么设计的呢?

@kiminh
Copy link

kiminh commented Feb 16, 2023

@qingyujean 你好,请问这个问题最后有解决方案吗

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

2 participants