Added close-matches example

This commit is contained in:
Armin Ronacher 2021-01-30 23:28:01 +01:00
parent 42437ce3d7
commit 182a998e0f
2 changed files with 19 additions and 0 deletions

15
examples/close-matches.rs Normal file
View file

@ -0,0 +1,15 @@
use similar::text::get_close_matches;
fn main() {
let words = vec![
"apple",
"appu",
"appal",
"apparitor",
"beer",
"beeb",
"beeline",
];
println!("{:?}", get_close_matches("app", &words, 3, 0.7));
println!("{:?}", get_close_matches("bee", &words, 3, 0.7));
}