pub fn fuzzy_match<S1: AsRef<str>, S2: AsRef<str>>(str1: S1, str2: S2) -> boolExpand description
Performs a fuzzy match between two strings using the default threshold.
This function uses the partial_ratio similarity score and the default threshold
(DEFAULT_FUZZ_THRESHOLD) to determine if the two strings are similar enough. If the similarity
score exceeds the default threshold, the strings are considered a match.
§Parameters
str1: The first string to compare, implementingAsRef<str>.str2: The second string to compare, implementingAsRef<str>.
§Returns
trueif the similarity score exceeds the default threshold.falseotherwise.
§Example
use lib2fas::fuzzy::fuzzy_match;
let is_match = fuzzy_match("hello world", "world");
if is_match {
println!("The strings are similar!");
} else {
println!("The strings are not similar.");
}