pub struct Tokenizer { /* private fields */ }Implementations§
Source§impl Tokenizer
impl Tokenizer
Sourcepub fn new(
text: &'_ str,
stopwords: &'_ [String],
punctuation: Option<&'_ [String]>,
) -> Self
pub fn new( text: &'_ str, stopwords: &'_ [String], punctuation: Option<&'_ [String]>, ) -> Self
Create a new Tokenizer instance.
Sourcepub fn split_into_words(&self) -> Vec<String>
pub fn split_into_words(&self) -> Vec<String>
Split text into words by splitting on word bounds.
Sourcepub fn sync_split_into_words(&self) -> Vec<String>
pub fn sync_split_into_words(&self) -> Vec<String>
Split text into words by splitting on word bounds (always synchronous even with parallel flag).
Sourcepub fn split_into_sentences(&self) -> Vec<String>
pub fn split_into_sentences(&self) -> Vec<String>
Split text into unicode sentences by splitting on punctuation.
Sourcepub fn sync_split_into_sentences(&self) -> Vec<String>
pub fn sync_split_into_sentences(&self) -> Vec<String>
Split text into unicode sentences (always synchronous even with parallel flag).
Sourcepub fn split_into_phrases(&self, length: Option<usize>) -> Vec<String>
pub fn split_into_phrases(&self, length: Option<usize>) -> Vec<String>
Split text into phrases by splitting on stopwords.
Sourcepub fn sync_split_into_phrases(&self, length: Option<usize>) -> Vec<String>
pub fn sync_split_into_phrases(&self, length: Option<usize>) -> Vec<String>
Split text into words by splitting on word bounds (always synchronous even with parallel flag).
Sourcepub fn split_into_paragraphs(&self) -> Vec<String>
pub fn split_into_paragraphs(&self) -> Vec<String>
Split text into paragraphs by splitting on newlines.
Sourcepub fn sync_split_into_paragraphs(&self) -> Vec<String>
pub fn sync_split_into_paragraphs(&self) -> Vec<String>
Split text into paragraphs (always synchronous even with parallel flag).
Auto Trait Implementations§
impl Freeze for Tokenizer
impl RefUnwindSafe for Tokenizer
impl Send for Tokenizer
impl Sync for Tokenizer
impl Unpin for Tokenizer
impl UnwindSafe for Tokenizer
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