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

Unable to use token_stream #9

Open
elwin212 opened this issue Oct 12, 2023 · 3 comments
Open

Unable to use token_stream #9

elwin212 opened this issue Oct 12, 2023 · 3 comments

Comments

@elwin212
Copy link

Hi,

I followed your example:

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

but it gave me error in this line:
tokenizer.token_stream("测试");

The error msg is:

no method named `token_stream` found for struct `JiebaTokenizer` in the current scope
items from traits can only be used if the trait is in scope`

How can I fix that?

Many thanks

@jiegec
Copy link
Owner

jiegec commented Oct 13, 2023

Which versions of tantivy and tantivy-jieba are you using?

@elwin212
Copy link
Author

This is my cargo.toml

[dependencies]
tantivy = "0.21.0"
tantivy-jieba = "0.10.0"

@jiegec
Copy link
Owner

jiegec commented Oct 13, 2023

This is my cargo.toml

[dependencies]
tantivy = "0.21.0"
tantivy-jieba = "0.10.0"

I could not reproduce your problem, it works here.

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

2 participants