A BK Trees (Burkhard-Keller Trees)与模糊字符串搜索(例如拼写检查,单词推荐)相关联。所有的BK树搜索算法都与explained here相同。目标是返回,例如"seek" and "peek" if I search for "aeek"。BK - 树搜索全部
现在,我的问题是,我想利用这个模糊字符串搜索算法来搜索从所有类似的项目给予词典。例如,给一个词“寻找”,我想找到全部类似的单词,如“偷看”,“怪胎”,“座位”等字典内。但是我发现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。
我要的是,使用,给定任意的四个Python的书我上面sample test,一个SearchAll
函数总是返回四个Python的书,尽管字典构建顺序,或搜索完成的顺序。
但是,我尝试了很多方法,但都失败了(例如,this is one of them)。现在我正在甩手并寻求帮助。伪代码或通用算法描述会做。谢谢。
@templatetypedef? – xpt
@Duck,你能帮忙吗? – xpt