pub struct StatefulTokenizer<D> { /* private fields */ }
Implementations§
source§impl<D: DictionaryAccess + Clone> StatefulTokenizer<D>
impl<D: DictionaryAccess + Clone> StatefulTokenizer<D>
sourcepub fn dict_clone(&self) -> D
pub fn dict_clone(&self) -> D
Get a clone of current dictionary
source§impl<D: DictionaryAccess> StatefulTokenizer<D>
impl<D: DictionaryAccess> StatefulTokenizer<D>
sourcepub fn create(dic: D, debug: bool, mode: Mode) -> Self
pub fn create(dic: D, debug: bool, mode: Mode) -> Self
Create a new debug stateful tokenizer with the following options
sourcepub fn set_mode(&mut self, mode: Mode) -> Mode
pub fn set_mode(&mut self, mode: Mode) -> Mode
Set the analysis mode and returns the current one
sourcepub fn set_subset(&mut self, subset: InfoSubset) -> InfoSubset
pub fn set_subset(&mut self, subset: InfoSubset) -> InfoSubset
Analyzer will read only following [WordInfo
] field subset
sourcepub fn reset(&mut self) -> &mut String
pub fn reset(&mut self) -> &mut String
Prepare StatefulTokenizer for the next data. Data must be written in the returned reference.
sourcepub fn do_tokenize(&mut self) -> SudachiResult<()>
pub fn do_tokenize(&mut self) -> SudachiResult<()>
Perform the actual tokenization so the analysis result will be available for consumption
sourcepub fn swap_result(
&mut self,
input: &mut InputBuffer,
result: &mut Vec<ResultNode>,
subset: &mut InfoSubset,
)
pub fn swap_result( &mut self, input: &mut InputBuffer, result: &mut Vec<ResultNode>, subset: &mut InfoSubset, )
Swap result data with the current analyzer
sourcepub fn into_morpheme_list(self) -> SudachiResult<MorphemeList<D>>
pub fn into_morpheme_list(self) -> SudachiResult<MorphemeList<D>>
Consume the Tokenizer and produce MorphemeList
Auto Trait Implementations§
impl<D> Freeze for StatefulTokenizer<D>where
D: Freeze,
impl<D> RefUnwindSafe for StatefulTokenizer<D>where
D: RefUnwindSafe,
impl<D> Send for StatefulTokenizer<D>where
D: Send,
impl<D> Sync for StatefulTokenizer<D>where
D: Sync,
impl<D> Unpin for StatefulTokenizer<D>where
D: Unpin,
impl<D> UnwindSafe for StatefulTokenizer<D>where
D: UnwindSafe,
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more