6 releases

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

#478 in Text processing

Download history 4/week @ 2024-07-18 15/week @ 2024-07-25 3/week @ 2024-09-19 16/week @ 2024-09-26 4/week @ 2024-10-03

302 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–16MB
~215K SLoC