The EditDistance structure

The EditDistance structure computes the "optimal string alignment" (or Levenshtein) distance between two strings.


structure EditDistance


val distance : string * string -> int


val distance : string * string -> int

distance (s1, s2) returns the number of edit operations required to make the two strings equal. Edit operations include deleting a character, inserting a character, replacing a character with another, and swapping two adjacent characters.