1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! Damerau-Levenshtein distance
use ;
/// This `struct` is used to access the Damerau-Levenshtein algorithm, as
/// implemented by the [rapidfuzz](https://crates.io/crates/rapidfuzz) crate,
/// in a generic manner.
///
/// The Damerau-Levenshtein distance measures the minimum number of operations
/// required to transform one string into another, considering four types of
/// elementary edits: `insertions`, `deletions`, `substitutions`, and
/// `transpositions of adjacent characters`. A transposition involves swapping
/// two adjacent characters. It does respect triangle inequality, and is thus a
/// metric distance.
///
/// It’s often used in applications where transpositions are common. An example
/// for this would be typing errors involving adjacent characters.
;
/// This `BatchComparator` trait implementation is used to access the
/// Damerau-Levenshtein algorithm, as implemented by the
/// [rapidfuzz](https://crates.io/crates/rapidfuzz) crate, in a generic manner.
// impl