[ml] Levenshtein distance package

Mike Schachter mike at mindmech.com
Tue Jul 20 04:12:20 UTC 2010


Hey everyone,

For the Kaggle HIV project Adam used a nice looking
package for computing Levenshtein distances, found
here:

http://code.google.com/p/pylevenshtein/

To build the package:

1) Download source
2) Do "python setup.py build"
3) Do "sudo python setup.py install"

You can use the functions with code such as the
following:

import Levenshtein

str1 = 'ABCD'
str2 = 'ABCP'

editDistance = Levenshtein.distance(str1, str2)
print 'Distance between %s and %s: %d' % (str1, str2, editDist)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.noisebridge.net/pipermail/ml/attachments/20100719/a06d574f/attachment-0001.html>


More information about the ml mailing list