[Tutor] comparing almost equal strings

thomas coopman thomas.coopman at gmail.com
Thu Feb 8 12:36:24 CET 2007


Hi,

I need a function that groups almost equal strings.  It seems most easy
to me, to do this with a hash function.

So I would write a hash function like this:
string = string.replace(" ", "").lower()[0:6]

and then hash the string chars, but it should detect minor typo's, so
words with one different char in the 6 chars, should have the same hash.

I think I once read something about it, but I can't find it, 
does somebody know how to do this?

Also do you think this is a good way, or do some of you have experience
with this and know a better way?

Thanks


More information about the Tutor mailing list