Rob W. W. Hooft wrote: > After reading this thread, I have wrapped up a different approach, > probably not what you were looking for, but it is very good for what I > wanted: comparing a command string typed by a user with all possible > commands a program can accept, to be able to do typo-correction. The > method will return a floating point number between 0.0 (no match) and > len(s)+1.0 (if the strings are exactly equal). You can see the score as > "the number of equal letters". [...] Interesting, but the result is a bit puzzling. Wouldn't it be easier if it is normalized to a float between 0.0 and 1.0?
Furthermore, I can also produce wrong(?) results: $ python comparestrings.py s1: test s2: x Score: -0.4 Minus 0.4... Is this a bug? --Irmen -- http://mail.python.org/mailman/listinfo/python-list