Comparing 2 similar strings?

Steven D'Aprano steve at REMOVETHIScyber.com.au
Thu May 19 11:14:42 EDT 2005


On Thu, 19 May 2005 07:07:56 +1000, John Machin wrote:

> On Wed, 18 May 2005 13:45:30 -0700, Don <donald.welch at NOSPAM.hp.com>
> 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)

I agree that this makes the edit distance broken in the context of text
strings, but you should be aware that distance is only commutative if
there are no constraints on travel. If you've ever driven around cities
like Sydney that use lots of one-way streets, you will know that the
distance from point A to point B is not necessarily the same as the
distance from B back to A.


-- 
Steven





More information about the Python-list mailing list