Skip to content

Instantly share code, notes, and snippets.

View AbcAeffchen's full-sized avatar

Alex Schickedanz AbcAeffchen

View GitHub Profile
@AbcAeffchen
AbcAeffchen / levenshtein.sql
Created February 26, 2018 17:33
MySQL - ReducedLevenshtein
-- store this as a procedure lv_leq_2. To be able to call this "revursivly"
-- you have to add this function a second time named lv_leq_1. lv_leq_0 stopps
-- the recursion and just compares if two strings are equal.
BEGIN
DECLARE s1_len, s2_len, i INT;
SET s1_len = CHAR_LENGTH(s1), s2_len = CHAR_LENGTH(s2), i = 1;
IF s1 = s2 THEN
RETURN TRUE;
ELSEIF ABS(s1_len - s2_len) > 3 THEN

Keybase proof

I hereby claim:

To claim this, I am signing this object: