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