Struct fiveo::Matcher
[−]
[src]
pub struct Matcher<'a> { /* fields omitted */ }
A fuzzy-search algorithm that uses bitmasks to perform fast string comparisons.
Example:
let searcher = fiveo::Matcher::new("my_word1\nmy_word2\n", fiveo::MatcherParameters::default()).unwrap(); // Search for "my_word1" and return a maximum of 10 results. let matches = searcher.search("my_word1", 10);
Methods
impl<'a> Matcher<'a>
[src]
pub fn new(
dictionary: &str,
parameters: MatcherParameters
) -> Result<Matcher, MatcherError>
[src]
dictionary: &str,
parameters: MatcherParameters
) -> Result<Matcher, MatcherError>
Create a new Matcher
from the given input data. The input data should contain
a list of input entries delimited by newlines that a matching dictionary can be built from.
pub fn search(&self, query: &str, max_results: usize) -> Vec<SearchResult>
[src]
Search for Candidate
s that approximately match the given query
string and return a
list of SearchResult
s.