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-02-25 04:26:01
最后一次提交
發布數42
最新版本名稱v0.7.2 (發布於 2025-01-21 20:55:13)
第一版名稱v0.1.0 (發布於 )
用户参与
星數810
關注者數14
派生數50
提交數327
已啟用問題?
問題數49
打開的問題數9
拉請求數62
打開的拉請求數2
關閉的拉請求數5
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?