Struct conllx::TokenBuilder
[−]
[src]
pub struct TokenBuilder { /* fields omitted */ }
A builder for Token
s.
The Token
type stores a CoNLL-X token. However, since this format
permits a large number of fields, construction of a token can get
tedious. This builder provides a fluent interface for creating Token
s.
Methods
impl TokenBuilder
[src]
fn new<S>(form: S) -> TokenBuilder where
S: Into<String>,
S: Into<String>,
Create a Token
builder with all non-form fields set to absent.
fn form<S>(self, form: S) -> TokenBuilder where
S: Into<String>,
S: Into<String>,
Set the word form or punctuation symbol.
fn lemma<S>(self, lemma: S) -> TokenBuilder where
S: Into<String>,
S: Into<String>,
Set the lemma or stem of the word form.
fn cpos<S>(self, cpos: S) -> TokenBuilder where
S: Into<String>,
S: Into<String>,
Set the coarse-grained part-of-speech tag.
fn pos<S>(self, pos: S) -> TokenBuilder where
S: Into<String>,
S: Into<String>,
Set the fine-grained part-of-speech tag.
fn features(self, features: Features) -> TokenBuilder
Set the syntactic and/or morphological features of the token.
fn head(self, head: usize) -> TokenBuilder
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 head_rel<S>(self, head_rel: S) -> TokenBuilder where
S: Into<String>,
S: Into<String>,
Set the dependency relation to the head of this token.
fn p_head(self, p_head: usize) -> TokenBuilder
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 p_head_rel<S>(self, p_head_rel: S) -> TokenBuilder where
S: Into<String>,
S: Into<String>,
Set the dependency relation to the projective head of this token.