Skip to main content

approximate_contains

Function approximate_contains 

Source
fn approximate_contains(haystack: &str, needle: &str, max_dist: usize) -> bool
Expand description

Check whether haystack contains a substring approximately matching needle within the given maximum edit distance. Uses a sliding-window approach: for each window of length needle.len() +/- max_dist, compute Levenshtein distance.