note 73606 deleted from function.levenshtein by salathe

From: Date: Mon, 18 Nov 2013 09:02:07 +0000
Subject: note 73606 deleted from function.levenshtein by salathe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-197549@lists.php.net to get a copy of this message
Note Submitter: Paul ---- @ ivo_gelov at gmx dot net Your implementation of Myers' algorithm is not entirely correct. The algorithm finds the end of a match, but you still need to find the start of a match. The easiest way to find the start of a match is to execute the algorithm again on the reversed string, starting at the j'th character. You can't just assume the start of the match is at j - m because you don't know whether the match is longer, shorter, or of equal length. Just my 2 cents.

« previous php.notes (#197549) next »