On Fri, May 29, 2020 at 6:02 PM Tom Tromey <tro...@adacore.com> wrote: > This patch changes gcc's spell checker to prefer simple case changes > when possible. > > I tested this using the self-tests. A new self-test is also included.
I think that's great, but it should be mentioned in the comment that the distance function used is not the Damerau-Levenshtein distance, and not a metric. (No triangle inequality. For example, the distance between "aB" and "ba" is 4, but the distance between "aB" and "ab" is 1 and that between "ab" and "ba" is 2, unless I missed something very clever in your code.) IIRC, minimum string alignment does not satisfy the triangle inequality anyway, so test_metric_conditions should probably not pretend to test it...