Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/kkweon/papago-rust
- Owner: kkweon
- License: mit
- Created: 2018-12-15T06:46:33.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-15T07:47:50.000Z (about 6 years ago)
- Last Synced: 2024-10-29T08:21:28.770Z (2 months ago)
- Language: Rust
- Homepage: https://kkweon.github.io/papago-rust/
- Size: 25.1 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 APIUSAGE:
papago [FLAGS] [OPTIONS]FLAGS:
-h, --help Prints help information
--nmt USE NMT API (default)
--smt USE SMT API
-V, --version Prints version informationOPTIONS:
-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
```