tantivy
tantivy copied to clipboard
`TokenizerManager` name is a bit misleading
The TokenizerManager is, in fact, more a TextAnalyzerManager:
pub struct TokenizerManager {
tokenizers: Arc<RwLock<HashMap<String, TextAnalyzer>>>,
}
I would be in favor of a renaming though I don't fully understand the implications.
What do you think?
Admittedly nothing to do with the name, but since it already is part of the dependency closure, I wonder whether ArcSwap<HashMap<String, TextAnalyzer>> is a better fit for this mostly-initialization-then-just-reading data structure?
Ok with me.
I think we should change that to
pub struct TokenizerManager {
tokenizers: ArcSwap<HashMap<String, Box<dyn Tokenizer>>>,
}
While TextAnalyzer is actually a TokenizerBuilder