https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69968

--- Comment #2 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #1)
> but the distance from coorzd1 to coordz1 should be 2 one deletion and one
> insertion.  Why's that not found?

I think the distance given in the initial comment is slightly wrong, sorry.

AIUI, with Levenshtein as the distance metric, *all* of the fields have
distance 2 (rather than 3): "coorzd1" to "coordx" can be reached by a deletion
and a substitution:
  coorzd1 -> coord1 -> coordx  (Levenshtein distance = 2)

Similarly for all "coord{xyz}":

  coorzd1 -> coord1 -> coord{xyz}  (Levenshtein distance = 2)

For "coord{xyz}1" we have:

  coorzd1 -> coord1 -> coord{xyz}1 (Levenshtein distance = 2)

i.e. all fields have Levenshtein distance of 2 from "coorzd1".

With Damerau-Levenshtein, we'd have (I think):

  coorzd1 -> coorzd1 (Damerau-Levenshtein distance = 1)
  coorzd1 -> coord1 -> coord{xy}[1] (Damerau-Levenshtein distance = 2)
  coorzd1 -> coordz1 -> coordz (Damerau-Levenshtein distance = 2)

and hence "coorzd1" would be uniquely closer to "coorzd1" than all of the other
5 fields.

(using http://www.let.rug.nl/kleiweg/lev/, and adjusting all weights to 1)

Reply via email to