Struct conllx::Token
[−]
[src]
pub struct Token { /* fields omitted */ }
A token with the CoNLL-X annotation layers.
The fields of CoNLLX tokens are described at:
This type provides exactly the same fields, except for the ID field
(since it can be derived from the sentence position of the token).
If a particular field is absent (_ in the CoNLL-X format), its
value is None
.
Methods
impl Token
[src]
fn new() -> Token
Create a new token where all the fields are absent.
fn form(&self) -> Option<&str>
Get the word form or punctuation symbol.
fn lemma(&self) -> Option<&str>
Get the lemma or stem of the word form.
fn cpos(&self) -> Option<&str>
Get the coarse-grained part-of-speech tag.
fn pos(&self) -> Option<&str>
Get the fine-grained part-of-speech tag.
fn features(&self) -> Option<&Features>
Get the syntactic and/or morphological features of the token.
fn head(&self) -> Option<usize>
Get the head of the token. This is the sentence position of the head plus one. If the head is 0, the token the root of the dependency tree.
fn head_rel(&self) -> Option<&str>
Get the dependency relation to the head of this token.
fn p_head(&self) -> Option<usize>
Get the projective head of the token. This is the sentence position of the head plus one. If the head is 0, the token the root of the dependency tree. The dependency structure resulting from the projective heads must be projective.
fn p_head_rel(&self) -> Option<&str>
Get the dependency relation to the projective head of this token.
fn set_form<S>(&mut self, form: Option<S>) where
S: Into<String>,
S: Into<String>,
Set the word form or punctuation symbol.
fn set_lemma<S>(&mut self, lemma: Option<S>) where
S: Into<String>,
S: Into<String>,
Set the lemma or stem of the word form.
fn set_cpos<S>(&mut self, cpos: Option<S>) where
S: Into<String>,
S: Into<String>,
Set the coarse-grained part-of-speech tag.
fn set_pos<S>(&mut self, pos: Option<S>) where
S: Into<String>,
S: Into<String>,
Set the fine-grained part-of-speech tag.
fn set_features(&mut self, features: Option<Features>)
Set the syntactic and/or morphological features of the token.
fn set_head(&mut self, head: Option<usize>)
Set the head of the token. This is the sentence position of the head plus one. If the head is 0, the token the root of the dependency tree.
fn set_head_rel<S>(&mut self, head_rel: Option<S>) where
S: Into<String>,
S: Into<String>,
Set the dependency relation to the head of this token.
fn set_p_head(&mut self, p_head: Option<usize>)
Set the projective head of the token. This is the sentence position of the head plus one. If the head is 0, the token the root of the dependency tree. The dependency structure resulting from the projective heads must be projective.
fn set_p_head_rel<S>(&mut self, p_head_rel: Option<S>) where
S: Into<String>,
S: Into<String>,
Set the dependency relation to the projective head of this token.
Trait Implementations
impl Clone for Token
[src]
fn clone(&self) -> Token
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Token
[src]
impl PartialEq for Token
[src]
fn eq(&self, __arg_0: &Token) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Token) -> bool
This method tests for !=
.