A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/messense/jieba-rs below:

messense/jieba-rs: The Jieba Chinese Word Segmentation Implemented in Rust

🚀 Help me to become a full-time open-source developer by sponsoring me on GitHub

The Jieba Chinese Word Segmentation Implemented in Rust

Add it to your Cargo.toml:

[dependencies]
jieba-rs = "0.8"

then you are good to go. If you are using Rust 2015 you have to extern crate jieba_rs to your crate root as well.

use jieba_rs::Jieba;

fn main() {
    let jieba = Jieba::new();
    let words = jieba.cut("我们中出了一个叛徒", false);
    assert_eq!(words, vec!["我们", "中", "出", "了", "一个", "叛徒"]);
}
Enabling Additional Features
[dependencies]
jieba-rs = { version = "0.7", features = ["tfidf", "textrank"] }
cargo bench --all-features
Benchmark: Compare with cppjieba

This work is released under the MIT license. A copy of the license is provided in the LICENSE file.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4