pub struct Terminal { /* private fields */ }
Expand description
Struct representing a Terminal.
Terminal
s are represented by:
form
- word formpos
- part of speech taglemma
- (optional) lemmamorph
- (optional) morphological featuresspan
- position in the sentence
Implementations§
Source§impl Terminal
impl Terminal
Sourcepub fn new(form: impl Into<String>, pos: impl Into<String>, idx: usize) -> Self
pub fn new(form: impl Into<String>, pos: impl Into<String>, idx: usize) -> Self
Construct new Terminal.
Constructs a new Terminal with the given form and part-of-speech tag at the specified index.
Sourcepub fn span(&self) -> &Span
pub fn span(&self) -> &Span
Returns the Terminal
’s span.
A Terminal
’s span is defined as a tuple (n, n+1)
where n
is the 0-based position of
the Terminal
in the sentence.
Sourcepub fn set_form(&mut self, new_form: impl Into<String>) -> String
pub fn set_form(&mut self, new_form: impl Into<String>) -> String
Replace form with new_form
. Return old value.
Sourcepub fn set_label(&mut self, new_pos: impl Into<String>) -> String
pub fn set_label(&mut self, new_pos: impl Into<String>) -> String
Replace part of speech with new_pos
. Return old value.
Sourcepub fn features_mut(&mut self) -> &mut Features
pub fn features_mut(&mut self) -> &mut Features
Get this Terminal
’s Features
mutably.
This method initializes the features if they are None
.
Trait Implementations§
impl Eq for Terminal
Auto Trait Implementations§
impl Freeze for Terminal
impl RefUnwindSafe for Terminal
impl Send for Terminal
impl Sync for Terminal
impl Unpin for Terminal
impl UnwindSafe for Terminal
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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