What is the best algorithm for closest word

守給你的承諾、 提交于 2021-02-07 14:59:31

问题


What is the best algorithm for closest word.

Possible word dictionary is given and first characters in the input word can be wrong.


回答1:


One option is BK-trees - see my blog post about them here. Another, faster but more complex option is Levenshtein Automata, which I've also written about, here.




回答2:


There are tools such as HunSpell (open-source spell-checker widely including OpenOffice) which have approached the problem from multiple perspectives. One widely used criterion for deciding how close the words are is Levenshtein distance which is also used in HunSpell.




回答3:


You could use BLAST

and modify it to use the fact that words in a dictionary are discrete units which makes the process of matching more specific unlike a long DNA string.

BLAST already has built into it the notion of edit distances.

Alternatively, you could use suffix trees (Dan Gusfeld has an excellent book on basic string matching algorithms) and build in the idea of edit distances in.



来源:https://stackoverflow.com/questions/3603760/what-is-the-best-algorithm-for-closest-word

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!