Crate skimple

Crate skimple 

Source
Expand description

§skimple

skimple is a simple interface for skim fuzzy-matcher

§Best Match

use skimple::SkimpleMatcher;

let matcher = SkimpleMatcher::default();
let haystack = ["Mort", "Sourcery", "Wyrd Sisters", "Pyramids", "Guards! Guards!"];
let needle = "gards";

let result = matcher.fuzzy_best(&haystack, &needle);
assert_eq!(result, Ok("Guards! Guards!"));

§All Matches

use skimple::SkimpleMatcher;

let matcher = SkimpleMatcher::default();
let haystack = ["Mort", "Sourcery", "Wyrd Sisters", "Pyramids", "Guards! Guards!"];
let needle = "yr";

let result = matcher.fuzzy_all(&haystack, &needle);
assert_eq!(result, Ok(vec!["Wyrd Sisters", "Pyramids"]));

Structs§

SkimpleMatcher
A simple (skimple?) struct to wrap around SkimMatcherV2

Enums§

SkimpleError
Possible errors that can occur during a fuzzy search