Levenshtein Distance algorithm

LaggedOnUser laggedonuser at gmail.com
Sun Feb 18 08:08:25 PST 2007


Hello,

Some time ago, Walter mentioned that it might be possible to contribute code to Phobos.  He specified three possible ways of doing so, the first option was public domain.  I have written a simple implementation of the Levenshtein Distance algorithm for two strings which I am contributing to the public domain for possible use by Digital Mars or anyone else in case anyone is interested.  It is attached to this message, along with a few simple tests.  The implementation should be sound; I also tested it against a file of over 100,000 words and their pronunciations.  The result was in every case identical to the PHP implementation of Levenshtein function (see http://us2.php.net/levenshtein).

LaggedOnUser
-------------- next part --------------
A non-text attachment was scrubbed...
Name: levenshtein.d
Type: application/octet-stream
Size: 844 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20070218/296d554b/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.d
Type: application/octet-stream
Size: 402 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20070218/296d554b/attachment-0001.obj>


More information about the Digitalmars-d mailing list