[][src]Struct finalfrontier::SubwordVocab

pub struct SubwordVocab<C, I> { /* fields omitted */ }

A corpus vocabulary with subword lookup.

Methods

impl<C, I> SubwordVocab<C, I> where
    C: Copy + Clone,
    I: Indexer
[src]

pub fn new(
    config: SubwordVocabConfig<C>,
    words: Vec<Word>,
    n_tokens: usize,
    indexer: I
) -> Self
[src]

Construct a new vocabulary.

pub fn word(&self, word: &str) -> Option<&Word>[src]

Get the given word.

Trait Implementations

impl<C, I> Vocab for SubwordVocab<C, I> where
    C: Copy + Clone,
    I: Indexer
[src]

type VocabType = String

type IdxType = WordWithSubwordsIdx

type Config = SubwordVocabConfig<C>

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

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

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

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

impl From<SubwordVocab<BucketConfig, HashIndexer<FnvHasher>>> for VocabWrap[src]

impl From<SubwordVocab<NGramConfig, ExplicitIndexer>> for VocabWrap[src]

impl<C: Clone, I: Clone> Clone for SubwordVocab<C, I>[src]

Auto Trait Implementations

impl<C, I> Send for SubwordVocab<C, I> where
    C: Send,
    I: Send

impl<C, I> Sync for SubwordVocab<C, I> where
    C: Sync,
    I: Sync

impl<C, I> Unpin for SubwordVocab<C, I> where
    C: Unpin,
    I: Unpin

impl<C, I> UnwindSafe for SubwordVocab<C, I> where
    C: UnwindSafe,
    I: UnwindSafe

impl<C, I> RefUnwindSafe for SubwordVocab<C, I> where
    C: RefUnwindSafe,
    I: RefUnwindSafe

Blanket Implementations

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

impl<T> From<T> for 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.

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

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

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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,