You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Optimal String Alignment variant of Damerau–Levenshtein (sometimes called the restricted edit distance) computes the number of edit operations needed to make the strings equal under the condition that no substring is edited more than once, whereas the true Damerau–Levenshtein presents no such restriction.
213
215
216
+
Note that for the optimal string alignment distance, the triangle inequality does not hold and so it is not a true metric.
217
+
218
+
```java
219
+
importinfo.debatty.java.stringsimilarity.*;
220
+
221
+
publicclassMyApp {
222
+
223
+
224
+
publicstaticvoidmain(String[] args) {
225
+
OptimalStringAlignment d =newOptimalStringAlignment();
226
+
227
+
System.out.println(osa.distance("CA", "ABC"));;
228
+
}
229
+
}
230
+
```
231
+
232
+
Will produce:
233
+
234
+
```
235
+
3.0
236
+
```
214
237
215
238
## Jaro-Winkler
216
239
Jaro-Winkler is a string edit distance that was developed in the area of record linkage (duplicate detection) (Winkler, 1990). The Jaro–Winkler distance metric is designed and best suited for short strings such as person names, and to detect typos.
0 commit comments