[MySQL 4.1] Levenshtein in MySQL

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • [MySQL 4.1] Levenshtein in MySQL

    Hoihoi,

    hat jemand von euch ne Idee, wie ich Levenshtein in MySQL mache. mysql.com schweigt sich zu diesen Wort aus.

    Ich war mir aber Sicher, das es irgendwo eine User-Function bzw irgendwas gibt was man glaub ich in mysql einkompilieren musste.

    Any ideas?

  • #2
    Ich mach es jetzt per UDF.

    Falls jemand noch eine andere Lösung kennt - immer her damit.


    [2004-02-06] - MySQL Levenshtein Distance UDF
    Last month, I needed to use the metaphone and edit (Levenshtein) distance algorithms for a fuzzy search of a MySQL table. Of course, neither is available as a built-in MySQL function. So, I had to install them as UDFs. The MySQL source distribution includes a metaphone UDF function in udf_example.cc. However, I couldn't find a Levenshtein UDF anywhere, so I wrote one, by converting a C implementation by Lorenzo Seidenari. I suspect that other people could benefit from this code, and you can download it from joshdrew.com. I compared the function's output to that of the PHP levensthein() function for a couple million word pairs; the results agreed completely - that's good enough for me. (this code comes with no warranty whatsoever, but I really hope you find it useful)
    http://joshdrew.com/mysql_levenshtein_udf-1.0.tar.gz

    Kommentar

    Lädt...
    X