如何在mysql中添加levenshtein函数?

我从 http://kristiannissen.wordpress.com/2010/07/08/mysql-levenshtein/(archive.org 链接),但是如何在 MySQL 中添加该功能?我正在使用 XAMPP,我需要它在 PHP 中进行搜索.

I got the code for Levenshtein distance for MySQL from http://kristiannissen.wordpress.com/2010/07/08/mysql-levenshtein/(archive.org link), but how to add that function in MySQL? I am using XAMPP and I need it for search in PHP.

推荐答案

我已经连接到我的 MySQL 服务器并简单地执行了 MySQL Workbench 中的>此声明,它很有效——我现在有了新函数 levenshtein().

I have connected to my MySQL server and simply executed this statement in MySQL Workbench, and it simply worked - I now have new function levenshtein().

例如,这按预期工作:

SELECT levenshtein('abcde', 'abced')

2

相关文章