Help me find the algorithm name - quantify difference between two words

蓝咒 提交于 2019-12-10 15:43:55

问题


I know there is an algorithm for seeing how "close" two words are together. The idea is that this algorithm adds 1 point to the score for every single letter addition or subtraction that is necessary to transform one word into the other. The lower this score, the "closer" the two words are together.

For example, if we take the word "word" and "sword", their distance is 1. To go from "word" to "sword" all you have to do as add an "s" in the beginning.

For "week" and "welk" the distance is 2. You need to subtract the "e" and add an "l".

I remember this algorithm is used for sorting the suggestion list in spell-checkers. I cannot recall the name of this algo.

What is this algorithm called?


回答1:


Levenshtein Distance

Is it just me or is this simple algorithm great?




回答2:


This sounds a lot like the Levenshtein distance algorithm




回答3:


Levenshtein distance.




回答4:


Levenshtein distance

http://en.wikipedia.org/wiki/Levenshtein_distance




回答5:


Do you mean Levenshtein distance?



来源:https://stackoverflow.com/questions/1780257/help-me-find-the-algorithm-name-quantify-difference-between-two-words

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