🧪 | Experiments with ispell integration [maintainer=@uzbek-net]
Find a file
2023-06-02 05:43:05 +05:00
.github/workflows Update docs.yml 2023-01-21 20:00:42 +05:00
assets adding screenshots from the experiment 2023-06-02 05:42:38 +05:00
examples discontinued 2023-06-02 05:39:11 +05:00
src wait until it finishes child process 2023-06-02 04:30:49 +05:00
.gitignore [MAJOR] modernized to rust's 2021 edition 2023-01-21 11:30:41 +05:00
Cargo.toml adding tokio 2023-06-02 04:10:52 +05:00
ChangeLog.md Bump version 2020-07-04 03:07:38 +02:00
LICENSE.md Initiate repository 2016-09-25 17:59:51 +02:00
README.md Update README.md 2023-06-02 05:43:05 +05:00

rust-ispell

⚠️ Attention, the project is discontinued!

Using this library on your server will result in high CPU usage. SpellLauncher uses std::process::Command to run hunspell. However, every time you run hunspell, it creates a PID process and sending simultaneous requests to hunspell will spam processes which will result in high CPU usage.

Screenshots from the experiment

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

Usage

Add this to your Cargo.toml

[dependencies]
ispell = { git = "https://github.com/uzinfocom-org/rust-ispell", branch = "master" }

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 simple test to see if it detects 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.