levenshteinDistance

fnsize_t levenshteinDistance(alias equals = (a, b) => a == b, Range1, Range2)(Range1 s, Range2 t) if (isForwardRange!(Range1) && isForwardRange!(Range2))

Returns the Levenshtein distance between s and t. The Levenshtein distance computes the minimal amount of edit operations necessary to transform s into t. Performs s.length * t.length evaluations of equals and occupies min(s.length, t.length) storage.

Parameters

equalsThe binary predicate to compare the elements of the two ranges.
sThe original range.
tThe transformation target

Returns

The minimal number of edits to transform s into t.

Does not allocate GC memory.

fnsize_t levenshteinDistance(alias equals = (a, b) => a == b, Range1, Range2)(auto ref Range1 s, auto ref Range2 t) if (isConvertibleToString!Range1 || isConvertibleToString!Range2)

ditto