Function spelling::spellcheck_rayon [−][src]
pub fn spellcheck_rayon<'a>(
dictionary_string: &'a str,
word: &str,
distance: usize
) -> Vec<&'a str>
Takes a dictionary_string
(newline separated), a word and a distance and
returns a vector of possible matches, with a limit of distance set up
distance
. Sorts by distance. Uses rayon.
Notes:
- Use this whenever possible over the other
spellcheck
function. - This only works for single length code bytes.
- This uses the Levenshtein distance.
use spelling::spellcheck_rayon; let dictionary_string = include_str!("words.txt"); // newline separated spellcheck_rayon(dictionary_string, "restaraunt", 3);