Trait SentenceDecoder

Source
pub trait SentenceDecoder {
    type Encoding: ToOwned;
    type Error: Error;

    // Required method
    fn decode<S>(
        &self,
        labels: &[S],
        sentence: &mut Sentence,
    ) -> Result<(), Self::Error>
       where S: AsRef<[EncodingProb<Self::Encoding>]>;
}
Expand description

Trait for sentence decoders.

A sentence decoder adds a representation to each token in a sentence, such as a part-of-speech tag or a topological field.

Required Associated Types§

Source

type Encoding: ToOwned

Source

type Error: Error

The decoding error type.

Required Methods§

Source

fn decode<S>( &self, labels: &[S], sentence: &mut Sentence, ) -> Result<(), Self::Error>
where S: AsRef<[EncodingProb<Self::Encoding>]>,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§