Crate papago

source ·
Expand description

Papago module

Example

let auth = config::get_auth_from_env().unwrap();
let payload = PapagoReq {
    source: Lang::En,
    target: Lang::Ko,
    text: "HELLO WORLD".to_owned(),
};
let resp = send_request(NMT_URL, &auth, payload).unwrap();
assert_eq!(resp, "안녕 세계".to_owned());

Re-exports

pub use self::api::NMT_URL;
pub use self::api::SMT_URL;
pub use self::api::send_request;

Modules

Actual Papago API wrapper module.
CLI Arguments
Configuration module. It contains Auth

Structs

PapagoReq is the payload sent to Naver Papago API It has to be sent as a form request (x-www-form-urlencoded)

Enums

Lang is a target/source language For more information, check official doc