2 releases

0.1.1 Dec 24, 2019
0.1.0 Dec 24, 2019

#27 in #spelling

Apache-2.0 OR MIT

1MB
21K SLoC

C++ 17K SLoC // 0.1% comments M4 2K SLoC // 0.3% comments Visual Studio Project 820 SLoC Automake 701 SLoC // 0.0% comments Rust 542 SLoC // 0.1% comments Shell 118 SLoC // 0.2% comments Visual Studio Solution 76 SLoC

Contains (obscure autoconf code, 3KB) hunspell/configure.ac

rspell

rspell docs

A simple practical spellcheker.

Dependencies caveats

This crate wraps hunspell's source directly. To do so it uses the cc-rs crate when building. As such the same limitations applies, for example a compiler must be installed on the system.

Example

let spell = rspell::Spell::new("en_US").unwrap();

assert!(!spell.check_word("colour").correct());
assert!(spell.check_word("color").correct());

for bad in spell.check("Wht color is this flg?") {
    println!(
        "{} (offset: {}): possible corrections: {:?}",
        bad.word, bad.offset, bad.suggestions
    );
}

Loose goals

  • multi-lang support
  • remove the need for the cc-rs crate

License

This project is licensed under either of

Hunspell's licensing applies to hunspell's source files.

Dependencies

~17–29MB
~485K SLoC