pub fn levenshtein_limit(a: &str, b: &str, limit: u32) -> u32
Expand description

Levenshtein distance computation with a limit

This will limitate the levshtein distance up to a given maximum value. The usual reason for wanting to do this is to avoid unnecessary computation when a match between two strings can quickly be pruned as “different”.

This function also wraps levenshtein_limit_iter.

Example

use stringmetrics::levenshtein_limit;

let a = "abcdefg";
let b = "mmmmmmm";
assert_eq!(levenshtein_limit(a, b, 3), 3);