pub struct Token { /* private fields */ }
Expand description

Token

The Token type stores a CoNLL-U token. Various information can be associated with a token, such as its lemma, (universal) part-of-speech, morphological features, and other (miscellaneous) features.

Tokens are typically stored as vertices in a DepGraph, so that their dependency heads and dependents can be queried.

Implementations

Create a new token where all the non-form fields are absent.

Get the word form or punctuation symbol.

Get the lemma or stem of the word form.

Get the universal part-of-speech tag.

Get the language-specific part-of-speech tag.

Get the syntactic and/or morphological features of the token.

Get the syntactic and/or morphological features of the token.

Returns a mutable reference, so that the features can be updated.

Get enhanced dependencies.

Warning: this method will be removed once proper support for enhanced dependencies is added.

Get miscellaneous token features.

Get miscellaneous token features.

Returns a mutable reference, so that the information can be updated.

Set the word form or punctuation symbol.

Returns the form that is replaced.

Set the lemma or stem of the word form.

Returns the lemma that is replaced.

Set the universal part-of-speech tag.

Returns the universal part-of-speech tag that is replaced.

Set the language-specific part-of-speech tag.

Returns the language-specific part-of-speech tag that is replaced.

Set the syntactic and/or morphological features of the token.

Returns the features that are replaced.

Set UD enhanced dependencies.

Warning: this method will be removed once proper support for enhanced dependencies is added.

Set miscellaneous token features.

Returns the features that are replaced.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Creates a value from an iterator. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.