Skip to content

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

Open

Description

@qingyujean

代码中正向最大实体搜索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吗,还是作者故意这么设计的呢?

Activity

  1. kiminh commented on Feb 16, 2023

    @kiminh

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions