pub struct Tokenizer {
pub dictionary: Dictionary,
pub user_dictionary: Option<UserDictionary>,
pub mode: Mode,
}Expand description
Tokenizer
Fields§
§dictionary: DictionaryThe dictionary to be used for tokenization.
user_dictionary: Option<UserDictionary>The user dictionary to be used for tokenization. (Optional)
mode: ModeThe tokenization mode.
Implementations§
Source§impl Tokenizer
impl Tokenizer
Sourcepub fn from_config(config: TokenizerConfig) -> LinderaResult<Self>
pub fn from_config(config: TokenizerConfig) -> LinderaResult<Self>
Create a new tokenizer from the tokenizer config.
§Arguments
config: The tokenizer config.
returns: LinderaResult
Sourcepub fn new(
dictionary: Dictionary,
user_dictionary: Option<UserDictionary>,
mode: Mode,
) -> Self
pub fn new( dictionary: Dictionary, user_dictionary: Option<UserDictionary>, mode: Mode, ) -> Self
Create a new tokenizer.
§Arguments
dictionary: The dictionary to be used for tokenization.user_dictionary: The user dictionary to be used for tokenization. (Optional)mode: The tokenization mode.
returns: LinderaResult
Trait Implementations§
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