Expand description

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);

Structs

Enums