我有一个执行一些基本词法分析的应用程序,我正在寻找一种有效的方法来计算将一个单词转换为另一个单词所需的更改操作的数量,一个字符一个字符地更改。
在此先感谢大家。
最佳答案
这听起来很像 Levenshtein Distance
The Levenshtein distance between two strings is defined as the minimum number of edits needed to transform one string into the other, with the allowable edit operations being insertion, deletion, or substitution of a single character
文章还链接到其他比较算法。
关于c# - 计算更改操作 c#,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3236081/