Struct syntaxdot_encoders::categorical::CategoricalEncoder[][src]

pub struct CategoricalEncoder<E, V, M> where
    V: Clone + Eq + Hash,
    M: Number<V>, 
{ /* fields omitted */ }

An encoder wrapper that encodes/decodes to a categorical label.

Implementations

impl<E, V, M> CategoricalEncoder<E, V, M> where
    V: Clone + Eq + Hash,
    M: Number<V>, 
[src]

pub fn new(encoder: E, numberer: Numberer<V>) -> Self[src]

impl<D, M> CategoricalEncoder<D, D::Encoding, M> where
    D: SentenceDecoder,
    D::Encoding: Clone + Eq + Hash + ToOwned,
    M: Number<D::Encoding>, 
[src]

pub fn decode_without_inner<S>(
    &self,
    labels: &[S]
) -> Vec<Vec<EncodingProb<D::Encoding>>> where
    S: AsRef<[EncodingProb<usize>]>, 
[src]

Decode without applying the inner decoder.

impl<E, V, M> CategoricalEncoder<E, V, M> where
    V: Clone + Eq + Hash,
    M: Number<V>, 
[src]

pub fn is_empty(&self) -> bool[src]

pub fn len(&self) -> usize[src]

Trait Implementations

impl<'de, E, V, M> Deserialize<'de> for CategoricalEncoder<E, V, M> where
    V: Clone + Eq + Hash,
    M: Number<V>,
    E: Deserialize<'de>,
    M: Deserialize<'de>, 
[src]

impl<D, M> SentenceDecoder for CategoricalEncoder<D, D::Encoding, M> where
    D: SentenceDecoder,
    D::Encoding: Clone + Eq + Hash,
    M: Number<D::Encoding>, 
[src]

type Encoding = usize

type Error = D::Error

The decoding error type.

impl<E, M> SentenceEncoder for CategoricalEncoder<E, E::Encoding, M> where
    E: SentenceEncoder,
    E::Encoding: Clone + Eq + Hash,
    M: Number<E::Encoding>, 
[src]

type Encoding = usize

type Error = E::Error

The encoding error type.

impl<E, V, M> Serialize for CategoricalEncoder<E, V, M> where
    V: Clone + Eq + Hash,
    M: Number<V>,
    E: Serialize,
    M: Serialize
[src]

Auto Trait Implementations

impl<E, V, M> RefUnwindSafe for CategoricalEncoder<E, V, M> where
    E: RefUnwindSafe,
    M: RefUnwindSafe,
    V: RefUnwindSafe

impl<E, V, M> Send for CategoricalEncoder<E, V, M> where
    E: Send,
    M: Send,
    V: Send

impl<E, V, M> Sync for CategoricalEncoder<E, V, M> where
    E: Sync,
    M: Sync,
    V: Sync

impl<E, V, M> Unpin for CategoricalEncoder<E, V, M> where
    E: Unpin,
    M: Unpin,
    V: Unpin

impl<E, V, M> UnwindSafe for CategoricalEncoder<E, V, M> where
    E: UnwindSafe,
    M: UnwindSafe,
    V: UnwindSafe

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<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

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.