4个版本 (2个重大更改)
使用旧的 Rust 2015
| 0.3.1 | 2020年7月4日 | 
|---|---|
| 0.3.0 | 2016年9月29日 | 
| 0.2.0 | 2016年9月26日 | 
| 0.1.0 | 2016年9月25日 | 
#15 in #拼写检查
每月62次下载
用于  2 crates
31KB
398 行
rust-ispell
此库允许从Rust中轻松使用 ispell 或 aspell。
用法
将此添加到您的 Cargo.toml
[dependencies]
ispell = "0.3"
示例
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]);
        }
    }
}
将显示
'simpel' (pos: 2) is misspelled!
Maybe you meant 'simple'?
'detetcs' (pos: 27) is misspelled!
Maybe you meant 'dietetics'?
(是的,这正是我的意思。)
文档
有关使用此库的更多信息,请参阅Github.io上的API文档或docs.rs。
需求
rust-ispell 0.3需要 Rustc 编译器的 1.12.0(或更高版本),因为它使用了仅在这次版本中稳定的 std::sync::mpcs::Receiver::recv_timeout。
变更日志
请参阅 ChangeLog.md。
许可证
rust-ispell 是自由软件,根据 Mozilla公共许可证,版本2.0 发布。