#tantivy #bridge #adapter #tokenizer #jieba #jieba-rs

tantivy-jieba

A library that bridges between tantivy and jieba-rs

12 releases (breaking)

0.11.0 Apr 28, 2024
0.10.0 Oct 13, 2023
0.9.0 Jul 3, 2023
0.7.0 Jan 5, 2023
0.1.1 Feb 13, 2019

#247 in Text processing

Download history 3318/week @ 2024-09-02 3219/week @ 2024-09-09 1543/week @ 2024-09-16 2303/week @ 2024-09-23 484/week @ 2024-09-30 1733/week @ 2024-10-07 2257/week @ 2024-10-14 2761/week @ 2024-10-21 3501/week @ 2024-10-28 3418/week @ 2024-11-04 1699/week @ 2024-11-11 932/week @ 2024-11-18 524/week @ 2024-11-25 798/week @ 2024-12-02 1210/week @ 2024-12-09 605/week @ 2024-12-16

3,168 downloads per month

MIT license

8KB
104 lines

tantivy-jieba

Crates.io version docs.rs Changelog FOSSA Status

An adapter that bridges between tantivy and jieba-rs.

Usage

Add dependency tantivy-jieba to your Cargo.toml.

Example

use tantivy::tokenizer::*;
let mut tokenizer = tantivy_jieba::JiebaTokenizer {};
let mut token_stream = tokenizer.token_stream("测试");
assert_eq!(token_stream.next().unwrap().text, "测试");
assert!(token_stream.next().is_none());

Register tantivy tokenizer

use tantivy::schema::Schema;
use tantivy::tokenizer::*;
use tantivy::Index;
let tokenizer = tantivy_jieba::JiebaTokenizer {};
let index = Index::create_in_ram(schema);
index.tokenizers()
     .register("jieba", tokenizer);

License

FOSSA Status

Dependencies

~9.5MB
~95K SLoC