jieba-rs

用 Rust 实现的 Jieba 汉字分词法。「The Jieba Chinese Word Segmentation Implemented in Rust」

Github星跟踪图

jieba-rs

GitHub Actions
codecov
Crates.io
docs.rs

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

The Jieba Chinese Word Segmentation Implemented in Rust

Installation

Add it to your Cargo.toml:

[dependencies]
jieba-rs = "0.7"

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.

Example

use jieba_rs::Jieba;

fn main() {
    let jieba = Jieba::new();
    let words = jieba.cut("我们中出了一个叛徒", false);
    assert_eq!(words, vec!["我们", "中", "出", "了", "一个", "叛徒"]);
}

Enabling Additional Features

  • default-dict feature enables embedded dictionary, this features is enabled by default
  • tfidf feature enables TF-IDF keywords extractor
  • textrank feature enables TextRank keywords extractor
[dependencies]
jieba-rs = { version = "0.7", features = ["tfidf", "textrank"] }

Run benchmark

cargo bench --all-features

Benchmark: Compare with cppjieba

jieba-rs bindings

License

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

主要指标

概览
名称与所有者messense/jieba-rs
主编程语言Rust
编程语言Rust (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2018-05-06 09:41:22
推送于2025-08-01 02:05:48
最后一次提交
发布数45
最新版本名称v0.8.0 (发布于 2025-07-30 22:05:34)
第一版名称v0.1.0 (发布于 )
用户参与
星数836
关注者数14
派生数54
提交数340
已启用问题?
问题数50
打开的问题数9
拉请求数71
打开的拉请求数2
关闭的拉请求数5
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?