Enum rust_tokenizers::Mask [−][src]
pub enum Mask { None, Whitespace, Punctuation, CJK, Special, Begin, Continuation, Unfinished, Unknown, }
Expand description
Variants
The token has no particular mask. This is the default situation. It may indicate that further processing can be done on a token.
The token represents a whitespace (in any shape or form)
The token represents punctuation (in any shape or form)
The token represents a single Chinese/Japanese/Korean character (including kana and hangul)
The token is a special marker (such as a separator marker, a class marker, etc)
The token is the begin in a series of subtokens, the offset refers specifically to the sub-token. Subsequent tokens in this sequence will carry the ‘Continuation’ mask
The token is the continuation of the previous token, the offset refers specifically to the sub-token. All but the first sub-token in a sequence carry this mask (the first carries ‘Begin’). (this is the reverse of Mask::Unfinished)
The token is the start of a token but not finished yet. All but the last sub-token in the a token sequence carry this mask. This is the reverse of Mask::Continuation.
The token is out of vocabulary, it is unknown by the tokenizer and it will decode to unknown. Tokens that can be decoded properly (but may still be out of vocabulary) should not set this.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Mask
impl UnwindSafe for Mask
Blanket Implementations
Mutably borrows from an owned value. Read more