5 releases

0.1.4 May 23, 2023
0.1.3 Dec 20, 2022
0.1.2 Dec 19, 2022
0.1.1 Dec 19, 2022
0.1.0 Dec 19, 2022

#1010 in Text processing

33 downloads per month

MIT license

4.5MB
352 lines

Contains (Zip file, 4.5MB) src/GrammalecteDist.zip

Grammalecte client

Crate Documentation

This crate is an Open Source Grammalecte client, written in Rust.

Please have a look at this crate documentation to learn more.


lib.rs:

Grammalecte Rust Client

This crate is a Rust client to the Grammalecte server API.

Grammalecte is an Open Source software that allows to do french spell-checking.

Integrated server

The optional feature embedded-server allows you to spin up an temporary web server that will act as Grammalecte backend, instead of targetting an existing instance:

use grammalecte_client::GrammalecteClient;

let msg = "Les ange sont inssuportables!";
let res = GrammalecteClient::start_server()
            .unwrap()
            .spell_check(msg)
            .await
            .unwrap();
println!("RESULT = {:#?}", res);

Suggestion

You can also ask Grammalecte to give you valid alternatives words:

use grammalecte_client::GrammalecteClient;

let res = GrammalecteClient::start_server()
            .unwrap()
            .suggest("bonjou")
            .await
            .unwrap();
assert!(res.suggestions.contains(&"bonjour".to_string()));
println!("RESULT = {:#?}", res);

Dependencies

~4–17MB
~258K SLoC