2 releases

0.1.1 Dec 24, 2019
0.1.0 Dec 24, 2019

#26 in #spell-checking

Download history 8/week @ 2024-09-20 16/week @ 2024-09-27 3/week @ 2024-10-04 22/week @ 2024-11-29 75/week @ 2024-12-06 18/week @ 2024-12-13

115 downloads per month

Apache-2.0 OR MIT

1MB
27K SLoC

C++ 17K SLoC // 0.1% comments PO File 6.5K SLoC // 0.3% 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

~12–21MB
~395K SLoC