Fuzzies
Fuzzies is a fast, friendly integration layer that bridges the gap between low-level finite state transducers (fst) and Levenshtein automata, saving you from writing tedious boilerplate.
More information about this crate can be found in the crate documentation
Installation
Example
use ;
Embedding Data
If you don't want to manage external .fst files on disk, embed the dataset directly into your application:
static DICT_DATA: & = include_bytes!;
let dict = from_embedded?;
Built with Fuzzies
Check out real-world projects utilizing fuzzies:
- Mamoru: A blazing-fast Git
commit-msghook that embeds a compiled dictionary of over 106,000 words to instantly catch and block typos before they make it into your version control history.
🎈 Performance
The following benchmarks were gathered using Criterion to evaluate lookup speeds for single and parallel batch searches.
You can re-run these benchmarks on your hardware using cargo bench.
Single Search
Dictionary Single Search/apple 6.8904 µs/iter (+/- 0.0174 µs)
Dictionary Single Search/baxana 8.1007 µs/iter (+/- 0.0321 µs)
Dictionary Single Search/missingword 12.1830 µs/iter (+/- 0.0285 µs)
Batch Search
Rayon Parallel Batch/100 queries 406.79 µs/iter (+/- 1.60 µs)
Rayon Parallel Batch/500 queries 1.9530 ms/iter (+/- 0.0051 ms)
Rayon Parallel Batch/1000 queries 3.9583 ms/iter (+/- 0.0141 ms)
[!NOTE] Benchmarks were executed on an Intel Core i5-10300H (4 cores, 8 threads, Battery set to High Performance mode). Performance may scale significantly higher on more modern or high-end CPUs.
License
This project is licensed under the MIT license.