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

Replace PreTokenizedString #2374

Open
PSeitz opened this issue Apr 24, 2024 · 0 comments
Open

Replace PreTokenizedString #2374

PSeitz opened this issue Apr 24, 2024 · 0 comments

Comments

@PSeitz
Copy link
Contributor

PSeitz commented Apr 24, 2024

PreTokenizedString is a way to provide pre tokenized text to tantivy.

I think this can be removed and be handled by the user provided tokenizer instead.

E.g. in the example from pre_tokenized_text.rs below, the field title could contain the serialized JSON instead, which the tokenizer would parse to return the tokens.

let short_man_json = r#"{
    "title":[{
        "text":"The Old Man",
        "tokens":[
            {"offset_from":0,"offset_to":3,"position":0,"text":"The","position_length":1},
            {"offset_from":4,"offset_to":7,"position":1,"text":"Old","position_length":1},
            {"offset_from":8,"offset_to":11,"position":2,"text":"Man","position_length":1}
        ]
    }]
}"#;
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