symspell/lib.rs
1/*!
2
3Spelling correction & Fuzzy search based on Symmetric Delete spelling correction algorithm.
4
5# Basic Example
6
7```
8use symspell::{SymSpell, AsciiStringStrategy, Verbosity};
9
10let mut symspell: SymSpell<AsciiStringStrategy> = SymSpell::default();
11
12symspell.load_dictionary("data/frequency_dictionary_en_82_765.txt", 0, 1, " ");
13
14let suggestions = symspell.lookup("roket", Verbosity::Top, 2);
15println!("{:?}", suggestions);
16
17let sentence = "whereis th elove hehad dated forImuch of thepast who couqdn'tread in sixtgrade and ins pired him";
18let compound_suggestions = symspell.lookup_compound(sentence, 2);
19println!("{:?}", compound_suggestions);
20```
21*/
22
23mod composition;
24mod edit_distance;
25mod string_strategy;
26mod suggestion;
27mod symspell;
28#[cfg(target_arch = "wasm32")]
29mod wasm;
30
31#[cfg(not(target_arch = "wasm32"))]
32pub use string_strategy::AsciiStringStrategy;
33pub use string_strategy::{StringStrategy, UnicodeStringStrategy, UnicodeiStringStrategy};
34pub use suggestion::Suggestion;
35pub use symspell::{SymSpell, SymSpellBuilder, Verbosity};
36
37#[cfg(target_arch = "wasm32")]
38pub use wasm::JSSymSpell;