Chapter 3 - Comparison Based on String Metric
Published online by Cambridge University Press: 04 June 2020
Summary
A string metric is any metric distance between entitieswhich can be associated with a string. String metric-based methods have beendeveloped and used for tackling various problems, from plagiarism detectionand DNA/RNA analysis, image analysis and recognition, to data mining andintegration, and incremental search, to name a few. In this chapter, weconsider some simple examples of metric distances and apply them to somereal examples related to language.
Levenshtein Distance
The most widely known string metric for measuring the difference between twosequences is the Levenshtein distance, also known asedit distance, named after Vladimir Levenshtein, whoconsidered this distance in 1965 (Levenshtein, 1966).
The Levenshtein distance L(a,b) between two given strings a andb, each composed of a set of characters, is defined asthe minimum number of edit operations, including characteraddition, removal, and replacement, needed to turn a intob or vice versa (see e.g. Apostolico and Galil [1997]).Here is an example of how the Levenshtein distance can be used.
Example: Levenshtein distances between three given words. Let usconsider three different locations in the Basque countries, labeled herewith k = 1, 2, 3, where three correspondingly differentdialects of Basque are spoken, and compare the three variants of the sameword, the Basque word for ‘I am’, in these locations. Thewords are a1 = naiz,a2 = nais, anda3 = nas. Comparing thesethree words with each other, we notice the following relations:
• a1 = naiz vs.a2 = nais:naiz → nais by onereplacement operation z →s; thus, L12 =L(naiz, nais)= 1.
• a1 = naiz vs.a3 = nas:naiz → nais →nas by two edit operations: replacementz → s and deletion ofi; so L13 =L(naiz, nas)= 2.
- Type
- Chapter
- Information
- Languages in Space and TimeModels and Methods from Complex Systems Theory, pp. 41 - 78Publisher: Cambridge University PressPrint publication year: 2020