bosonnlp/
lib.rs

1//! [`BosonNLP`](http://bosonnlp.com) SDK for Rust
2//!
3//!
4//! ## 安装
5//!
6//! 在 ``Cargo.toml`` 增加如下内容:
7//!
8//! ```toml
9//! [dependencies]
10//! bosonnlp = "0.10"
11//! ```
12//!
13//! ## 使用教程
14//!
15//! API Token 申请请访问 http://bosonnlp.com
16//!
17//! ```
18//! extern crate bosonnlp;
19//!
20//! use bosonnlp::BosonNLP;
21//!
22//! fn main() {
23//!     let nlp = BosonNLP::new(env!("BOSON_API_TOKEN"));
24//!     let rs = nlp.sentiment(&["这家味道还不错"], "food").unwrap();
25//!     assert_eq!(1, rs.len());
26//! }
27//! ```
28//!
29//! 可以在 [`BosonNLP` 文档网站](http://docs.bosonnlp.com) 阅读详细的 `BosonNLP` REST API 文档。
30#![recursion_limit = "1024"]
31
32#[macro_use]
33extern crate log;
34extern crate url;
35extern crate uuid;
36extern crate reqwest;
37extern crate flate2;
38extern crate serde;
39#[macro_use]
40extern crate serde_derive;
41#[macro_use]
42extern crate serde_json;
43extern crate failure;
44#[macro_use]
45extern crate failure_derive;
46
47mod rep;
48mod client;
49mod task;
50mod errors;
51
52pub use self::client::BosonNLP;
53pub use self::errors::*;
54pub use self::rep::*;