[−][src]Function triple_accel::levenshtein::rdamerau
pub fn rdamerau(a: &[u8], b: &[u8]) -> u32
Returns the restricted Damerau-Levenshtein distance between two strings using SIMD acceleration.
Note that rdamerau_exp
may be much faster if the number of edits between the two strings
is expected to be small.
Internally, this will call levenshtein_simd_k_with_opts
.
If AVX2 or SSE4.1 is not supported, then this will automatically fall back to a scalar alternative.
Arguments
a
- first string (slice)b
- second string (slice)
Example
let dist = rdamerau(b"abc", b"acb"); assert!(dist == 1);