pub struct WordDelimiterFilter { /* private fields */ }Expand description
Splits code identifiers into subword tokens.
The original identifier can be preserved at the first subword position. If a token is not a compound identifier then it is passed through unchanged.
§Examples
use lance_tokenizer::{CodeLexTokenizer, TextAnalyzer, TokenStream, WordDelimiterFilter};
let mut analyzer = TextAnalyzer::builder(CodeLexTokenizer::new(false))
.filter(WordDelimiterFilter::new(true, true))
.build();
let mut stream = analyzer.token_stream("parseHTML2JSON");
let mut tokens = Vec::new();
stream.process(&mut |token| tokens.push(token.text.clone()));
assert_eq!(tokens, vec!["parseHTML2JSON", "parse", "HTML", "2", "JSON"]);Implementations§
Trait Implementations§
Source§impl Clone for WordDelimiterFilter
impl Clone for WordDelimiterFilter
Source§fn clone(&self) -> WordDelimiterFilter
fn clone(&self) -> WordDelimiterFilter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WordDelimiterFilter
impl RefUnwindSafe for WordDelimiterFilter
impl Send for WordDelimiterFilter
impl Sync for WordDelimiterFilter
impl Unpin for WordDelimiterFilter
impl UnsafeUnpin for WordDelimiterFilter
impl UnwindSafe for WordDelimiterFilter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more