2 stable releases
Uses old Rust 2015
1.0.1 | Jul 2, 2016 |
---|---|
1.0.0 | Jul 1, 2016 |
#15 in #spellcheck
320KB
209 lines
dym
A simple spelling corrector for Rust.
Inspired by Norvig's Spelling Corrector
Including in Cargo.toml
[dependencies]
dym = "1.0.0"
Usage
extern crate dym;
use dym::Lexicon;
let mut lex = Lexicon::new();
lex.insert("hello");
lex.insert("goodbye");
lex.insert("hell");
let corrections = lex.corrections_for("helo");
Commands Example
Type a misspelled git command.
cargo run --release --example commands pul
This outputs:
'pul' is not a command! did you mean:
push
pull
Spellchecker Example
Takes in a dictionary file and will suggest corrections for words typed through stdin.
cargo run --release --example spellchecker examples/words.txt