The next example comes from computer linguistics. We show how we can use a k-nearest neighbor classifier to recognize misspelled words.
We will measure the distance between two words with the Levenshtein distance. The minimum edit distance between two strings is the minimum numer of editing operations needed to convert one string into another. The editing operations can consist of insertions, deletions and substitutions.
The Levenshtein distance has the following properties: