对于弦距,是否有比Levenshtein更快(更不精确)的算法? [英] Is there a faster (less precise) algorithm than Levenshtein for string distance?

查看:71
本文介绍了对于弦距,是否有比Levenshtein更快(更不精确)的算法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想运行Levenshtein,但速度更快,因为它是我正在构建的实时应用程序。它可以在距离大于10时终止。

I want to run the Levenshtein, but WAY faster because it's real time application that I'm building. It can terminate once the distance is greater than 10.

推荐答案

Levenshtein距离度量允许添加,删除或替换操作。如果您正在寻找更快但不太精确的指标,可以使用最长的常见子序列(允许只有添加和删除)甚至汉明距离(仅允许替换)。

The Levenshtein distance metric allows addition, deletion or substitution operations. If you're looking for a faster but less precise metric you can use the longest common subsequence (allows only addition and deletion) or even the Hamming distance (allows only substitution).

但是,我建议您尝试优化Levenshtein距离算法,因为它可以获得最佳效果。

However, I recommend that you try to optimize your Levenshtein distance algorithm instead as it gives the best results.

这篇关于对于弦距,是否有比Levenshtein更快(更不精确)的算法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆