6 releases

0.1.5 Jun 14, 2024
0.1.4 May 23, 2023
0.1.3 Dec 20, 2022

#515 in Text processing

Download history 4/week @ 2024-09-20 16/week @ 2024-09-27 3/week @ 2024-10-04 14/week @ 2024-11-29 120/week @ 2024-12-06 29/week @ 2024-12-13 3/week @ 2024-12-20

159 downloads per month

MIT license

4.5MB
426 lines

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
~218K SLoC