4 releases (2 breaking)

Uses old Rust 2015

0.3.1 Jul 4, 2020
0.3.0 Sep 29, 2016
0.2.0 Sep 26, 2016
0.1.0 Sep 25, 2016

#15 in #spell-checking

Download history 23/week @ 2024-03-28 19/week @ 2024-04-04 8/week @ 2024-04-11 9/week @ 2024-04-18 7/week @ 2024-04-25 6/week @ 2024-05-02 8/week @ 2024-05-09 7/week @ 2024-05-16 12/week @ 2024-05-23 7/week @ 2024-05-30 10/week @ 2024-06-06 13/week @ 2024-06-13 11/week @ 2024-06-20 7/week @ 2024-06-27 29/week @ 2024-07-04

62 downloads per month
Used in 2 crates

MPL-2.0 license

31KB
398 lines

rust-ispell

This library allows to easily use ispell or aspell from Rust.

Usage

Add this to your Cargo.toml

[dependencies]
ispell = "0.3"

Example

extern crate ispell;
use ispell::SpellLauncher;

fn main() {
    let mut checker = SpellLauncher::new()
        .aspell()
        .dictionary("en_GB")
        .launch()
        .unwrap();
    let errors = checker.check("A simpel test to see if it detetcs typing errors").unwrap();
    for e in errors {
        println!("'{}' (pos: {}) is misspelled!", &e.misspelled, e.position);
        if !e.suggestions.is_empty() {
            println!("Maybe you meant '{}'?", &e.suggestions[0]);
        }
    }
}

will display:

'simpel' (pos: 2) is misspelled!
Maybe you meant 'simple'?
'detetcs' (pos: 27) is misspelled!
Maybe you meant 'dietetics'?

(Yes, that is exactly what I meant.)

Documentation

For more information about using this library, see the API documentation on Github.io or on docs.rs.

Requirements

rust-ispell 0.3 requires the 1.12.0 (or a more recent) version of the rustc compiler, since it uses the std::sync::mpcs::Receiver::recv_timeout that was only stabilized in this version.

ChangeLog

See ChangeLog.md.

License

rust-ispell is free software, published under the Mozilla Public License, version 2.0.

No runtime deps