The EditDistance structure

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

Synopsis

structure EditDistance

Interface

val distance : string * string -> int

Description

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.