dcjanus / cang-jie Goto Github PK
View Code? Open in Web Editor NEWChinese tokenizer for tantivy, based on jieba-rs
License: MIT License
Chinese tokenizer for tantivy, based on jieba-rs
License: MIT License
ref:
The problem is that when I want to create a snippet of tantivy query result, an error(byte index xx is out of bounds of xxxx
) will be raised. Looks like an out-of-bounds access to the string(byte array).
This is my test code: https://gist.github.com/WincerChan/09a1777944914164f6a22b62c95ec564
cargo dependencies:
After some works, I find the problem is token stream: https://github.com/DCjanus/cang-jie/blob/master/src/stream.rs#L30
The variable offset_from
does not start from 0, but from current_word.len()
, So there will be an out-of-bounds error at the last token.
If necessary, I can make a PR to fix it.
tantivy发布了0.16版本,根据其在CHANGELOG中的描述,仅仅是bugfix,所以可以安全地bump version。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.