pub enum Tag {
Outside,
Begin(String),
Inside(String),
End(String),
Single(String),
}Expand description
A single tagging-scheme tag.
Variants§
Outside
Outside any span.
Begin(String)
Begin a span of the given type.
Inside(String)
Inside (continue) a span of the given type.
End(String)
End of a multi-token span of the given type (BIOES only).
Single(String)
Single-token span of the given type (BIOES only).
Implementations§
Source§impl Tag
impl Tag
Sourcepub fn parse(s: &str) -> SeqResult<Tag>
pub fn parse(s: &str) -> SeqResult<Tag>
Parse a tag string such as "B-PER", "I-LOC", "S-ORG", or "O".
The case-sensitive single-letter prefix selects the variant; the
remainder after the - is the entity type.
§Errors
SeqError::InvalidObservation for an unrecognised prefix or a missing
-type body on a non-O tag.
Sourcepub fn to_tag_string(&self) -> String
pub fn to_tag_string(&self) -> String
Format this tag back into its canonical string.
Sourcepub fn entity_type(&self) -> Option<&str>
pub fn entity_type(&self) -> Option<&str>
The entity type (None for Tag::Outside).
Trait Implementations§
impl Eq for Tag
impl StructuralPartialEq for Tag
Auto Trait Implementations§
impl Freeze for Tag
impl RefUnwindSafe for Tag
impl Send for Tag
impl Sync for Tag
impl Unpin for Tag
impl UnsafeUnpin for Tag
impl UnwindSafe for Tag
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