【发布时间】:2017-08-26 21:39:40
【问题描述】:
BK Trees (Burkhard-Keller Trees) 与模糊字符串搜索相关联(例如拼写检查、单词推荐)。并且所有的 BK Trees 搜索算法都与explained here 相同。目的是返回,例如,"seek" and "peek" if I search for "aeek"。
现在,我的问题是,我正在尝试使用这种模糊字符串搜索算法从给定的字典中搜索所有相似的项目。例如,给定一个单词“seek”,我想在字典中找到所有相似的单词,例如“peek”、“geek”、“seat”等。但是我发现BK Trees searching algorithm that everyone uses 不是为此而设计的。
看看我的sample test result here。我发现the dictionary will be different if the feeding words order is different, thus the search result can be different as well。
我想要的是,使用我上面的sample test,给定四本 Python 书籍中的任何一本,SearchAll 函数将始终返回这四本 Python 书籍,尽管字典的构建顺序或搜索顺序是完毕。
但是,我尝试了很多方法,但都失败了(例如,this is one of them)。现在我举手寻求帮助。一个伪代码或通用算法描述就可以了。谢谢。
【问题讨论】:
-
@templatetypedef?
-
@Duck,你能帮忙吗?
标签: algorithm search data-structures fuzzy-search bk-tree