在MySQL中Damerau-Levenshtein距离算法函数算法、函数、距离、MySQL

2023-09-11 23:19:50 作者:每段路都是领悟

有谁知道一个MySQL的执行Damerau - 莱文斯坦距离算法作为一个存储过程/函数,它接受一个单一指定的字符串作为参数,并查找字符串的模糊匹配在某一特定领域的特定表中?< BR> 我发现,比较两个指定的字符串,工作了距离,但首先这仅仅是莱文斯坦距离算法,而不是Damerau - 莱文斯坦之一,其次,我不是找各种过程/函数code例子我的选择是类似于我指定字符串的领域比较两个字符串,但发现模糊匹配。 我基本上是试图把一个关键字模糊搜索MySQL中。

Does anyone know of a MySQL implementation of the Damerau–Levenshtein distance algorithm as a stored procedure/function that takes a single specified string as a parameter and looks for fuzzy matches of the string in a particular field within a particular table? I have found various procedure/function code examples that compares two specified strings and works out the distance, but firstly this is only the Levenshtein distance algorithm, and not the Damerau–Levenshtein one, and secondly, I'm not looking to compare two strings but find fuzzy matches in a field of my choosing that are similar to my specified string. I'm basically trying to put together a fuzzy keyword searcher in MySQL.

推荐答案

在 MySQL的莱文斯坦和Damerau - 莱文斯坦UDF的你有这种算法的几种实现。

In MySQL Levenshtein and Damerau-Levenshtein UDF’s you have several implementations of this algorithm.