string similarity in python

vincent wehren vincent at visualtrans.de
Mon Nov 24 15:06:34 EST 2003


"Achim Domma" <domma at procoders.net> schrieb im Newsbeitrag
news:bpsn1q$sm3$00$1 at news.t-online.com...
| Hi,
|
| I have a list of lets say 100-1000 strings and want to know which one is
| most similar to a reference string. Does somebody know such a library for
| Python? I don't need complicated scientific stuff, I think the most simple
| ones will do it for my data.
|
| regards,
| Achim
|
|

http://trific.ath.cx/resources/python/levenshtein/

It lets you calculate Levenshtein distance as well as a ratio of similarity
based on it, allowing you to "tweak" your results. You can use the source
both as C app or as C/Python extension module.

Getting it to do what you probably won't take you more than a few minutes...

Regards

Vincent Wehren







More information about the Python-list mailing list