[][src]Struct conllu::token::Token

pub struct Token { /* fields omitted */ }

Methods

impl Token[src]

pub fn new(form: impl Into<String>) -> Token[src]

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

pub fn form(&self) -> &str[src]

Get the word form or punctuation symbol.

pub fn lemma(&self) -> Option<&str>[src]

Get the lemma or stem of the word form.

pub fn upos(&self) -> Option<&str>[src]

Get the universal part-of-speech tag.

pub fn xpos(&self) -> Option<&str>[src]

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

pub fn features(&self) -> &Features[src]

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

pub fn features_mut(&mut self) -> &mut Features[src]

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

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

pub fn misc(&self) -> &Misc[src]

Get miscellaneous token features.

pub fn misc_mut(&mut self) -> &mut Misc[src]

Get miscellaneous token features.

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

pub fn set_form(&mut self, form: impl Into<String>) -> String[src]

Set the word form or punctuation symbol.

Returns the form that is replaced.

pub fn set_lemma<S>(&mut self, lemma: Option<S>) -> Option<String> where
    S: Into<String>, 
[src]

Set the lemma or stem of the word form.

Returns the lemma that is replaced.

pub fn set_upos<S>(&mut self, upos: Option<S>) -> Option<String> where
    S: Into<String>, 
[src]

Set the universal part-of-speech tag.

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

pub fn set_xpos<S>(&mut self, xpos: Option<S>) -> Option<String> where
    S: Into<String>, 
[src]

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

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

pub fn set_features(&mut self, features: Features) -> Features[src]

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

Returns the features that are replaced.

pub fn set_misc(&mut self, misc: Misc) -> Misc[src]

Set miscellaneous token features.

Returns the features that are replaced.

Trait Implementations

impl Clone for Token[src]

impl Debug for Token[src]

impl Eq for Token[src]

impl From<Token> for TokenBuilder[src]

impl From<TokenBuilder> for Token[src]

impl FromIterator<Token> for Sentence[src]

impl PartialEq<Token> for Token[src]

impl StructuralEq for Token[src]

impl StructuralPartialEq for Token[src]

Auto Trait Implementations

impl RefUnwindSafe for Token

impl Send for Token

impl Sync for Token

impl Unpin for Token

impl UnwindSafe for Token

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.