On Wed, 18 May 2005 13:45:30 -0700, Don <[EMAIL PROTECTED]> wrote: >http://www.personal.psu.edu/staff/i/u/iua1/python/apse/
The above is broken, not meeting one of the elementary conditions for a distance metric: distance(a, b) == distance(b, a) Quoting from its docs: | Note: The definition of the goodness of an approximate match is the | number of steps required to bring the string pattern to a form that is | entirely contained in the string to which it is being matched. Note: "entirely contained in", rather than "equal to". Now read on: | The mathing | is not commutative. The pattern that you instantiate the class with will be | matched against the input. For example the word "funky" can be made to | match the word "funnybone" with an edit distance of one. However, using | "funnybone" as a pattern that will be matched to "funky" the distance | will become five. | | Example: | | >>> from Apse import Approx | >>> a = Approx("funky") | >>> a.dist("funnybone") | 1 | >>> a = Approx("funnybone") | >>> a.dist("funky") | 5 -- http://mail.python.org/mailman/listinfo/python-list