[][src]Struct finalfrontier::VocabBuilder

pub struct VocabBuilder<C, T> { /* fields omitted */ }

Generic builder struct to count types.

Items are added to the vocabulary and counted using the count method. There is no explicit build method, conversion is done via implementing From<VocabBuilder<T>>.

Methods

impl<C, T> VocabBuilder<C, T> where
    T: Hash + Eq
[src]

pub fn new(config: C) -> Self[src]

pub fn count<S>(&mut self, item: S) where
    S: Into<T>, 
[src]

Trait Implementations

impl<T, S> From<VocabBuilder<SimpleVocabConfig, T>> for SimpleVocab<S> where
    T: Hash + Eq + Into<S>,
    S: Hash + Eq + Clone + Ord
[src]

Constructs a SimpleVocab<S> from a VocabBuilder<T> where T: Into<S>.

impl<T> From<VocabBuilder<SubwordVocabConfig, T>> for SubwordVocab where
    T: Hash + Eq + Into<String>, 
[src]

Constructs a SubwordVocab from a VocabBuilder<T> where T: Into<String>.

Auto Trait Implementations

impl<C, T> Send for VocabBuilder<C, T> where
    C: Send,
    T: Send

impl<C, T> Sync for VocabBuilder<C, T> where
    C: Sync,
    T: Sync

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.