Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kkweon/papago-rust

Papago API Rust Wrapper
https://github.com/kkweon/papago-rust

Last synced: 24 days ago
JSON representation

Papago API Rust Wrapper

Awesome Lists containing this project

README

        

# Papago Rust Wrapper
[![Build Status](https://travis-ci.com/kkweon/papago-rust.svg?branch=master)](https://travis-ci.com/kkweon/papago-rust)

## Library

```rust
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());
```

## Bin File

### Set up Environment Variables

```bash
export NAVER_CLIENT_ID="..."
export NAVER_CLIENT_SECRET="..."
```

### Help
```
Papago API

USAGE:
papago [FLAGS] [OPTIONS]

FLAGS:
-h, --help Prints help information
--nmt USE NMT API (default)
--smt USE SMT API
-V, --version Prints version information

OPTIONS:
-s, --source Source language [default: en] [possible values: ko, en, cn, tw, es, fr, vi, th, id]
-t, --target Target language [default: ko] [possible values: ko, en, cn, tw, es, fr, vi, th, id]

ARGS:
Text to translate
```