Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jieba::add_word panics when given empty word #109

Open
usaoc opened this issue Apr 18, 2024 · 0 comments
Open

Jieba::add_word panics when given empty word #109

usaoc opened this issue Apr 18, 2024 · 0 comments

Comments

@usaoc
Copy link

usaoc commented Apr 18, 2024

Example:

use jieba_rs::Jieba;

fn main() {
    let mut jieba = Jieba::new();
    jieba.add_word("", None, None);
}

gives

thread 'main' panicked at /path/to/cedarwood-0.4.6/src/lib.rs:302:13:
failed to insert zero-length key

Should the panic message be improved, and a note be added to the doc?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant