ccks_baidu_entity_link icon indicating copy to clipboard operation
ccks_baidu_entity_link copied to clipboard

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

Open qingyujean opened this issue 3 years ago • 1 comments

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

qingyujean avatar Sep 23 '21 02:09 qingyujean

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

kiminh avatar Feb 16 '23 12:02 kiminh