pub trait SentenceEncoder {
    type Encoding;
    type Error: Error;

    // Required method
    fn encode(
        &self,
        sentence: &Sentence
    ) -> Result<Vec<Self::Encoding>, Self::Error>;
}
Expand description

Trait for sentence encoders.

A sentence encoder extracts a representation of each token in a sentence, such as a part-of-speech tag or a topological field.

Required Associated Types§

source

type Encoding

source

type Error: Error

The encoding error type.

Required Methods§

source

fn encode( &self, sentence: &Sentence ) -> Result<Vec<Self::Encoding>, Self::Error>

Encode the given sentence.

Implementors§