You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
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 fromcurrent_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.
The text was updated successfully, but these errors were encountered: