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
45
46
47
48
49
//! Optimal String Alignment distance
use ;
/// This `struct` is used to access the Optimal String Alignment algorithm, as
/// implemented by the [rapidfuzz](https://crates.io/crates/rapidfuzz) crate, in
/// a generic manner.
///
/// The Optimal String Alignment distance (OSA) measures the minimum number of
/// operations required to transform one string into another, considering four
/// types of elementary edits: `insertions`, `deletions`, `substitutions`, and
/// `transpositions`.
///
/// While both the `Damerau-Levenshtein` and OSA distance include
/// transpositions, they differ in the treatment of transpositions. OSA treats
/// any transposition as a single operation, regardless of whether the
/// transposed characters are adjacent or not. In contrast, the
/// Damerau-Levenshtein distance specifically allows transpositions of adjacent
/// characters.
///
/// The handling of transpositions in the OSA distance is simpler, which makes
/// it computationally less intensive.
;
/// This `BatchComparator` trait implementation is used to access the
/// Optimal String Alignment algorithm, as implemented by the
/// [rapidfuzz](https://crates.io/crates/rapidfuzz) crate, in a generic manner.
// impl