[][src]Struct finalfusion::vocab::SubwordVocab

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

Vocabulary with subword units.

Methods

impl<I> SubwordVocab<I> where
    I: Indexer
[src]

pub fn new(
    words: impl Into<Vec<String>>,
    min_n: u32,
    max_n: u32,
    indexer: I
) -> Self
[src]

Construct a new SubwordVocab.

Words are assigned indices in the given order. NGrams in range (min_n..max_n) are considered. The indexer is used to look up indices for the NGrams produced by this SubwordVocab.

Panics when there are duplicate words.

pub fn indexer(&self) -> &I[src]

Get the vocab's indexer.

pub fn min_n(&self) -> u32[src]

Get the lower bound of the generated ngram lengths.

pub fn max_n(&self) -> u32[src]

Get the upper bound of the generated ngram lengths.

Trait Implementations

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

impl<I: Debug> Debug for SubwordVocab<I>[src]

impl<I: Eq> Eq for SubwordVocab<I>[src]

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

impl From<SubwordVocab<FastTextIndexer>> for VocabWrap[src]

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

impl<I> NGramIndices for SubwordVocab<I> where
    I: Indexer
[src]

impl<I: PartialEq> PartialEq<SubwordVocab<I>> for SubwordVocab<I>[src]

impl<I> StructuralEq for SubwordVocab<I>[src]

impl<I> StructuralPartialEq for SubwordVocab<I>[src]

impl<I> SubwordIndices for SubwordVocab<I> where
    I: Indexer
[src]

impl<I> Vocab for SubwordVocab<I> where
    I: Indexer
[src]

Auto Trait Implementations

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

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

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

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

impl<I> UnwindSafe for SubwordVocab<I> where
    I: 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> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<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<V, T> VZip<V> for T where
    V: MultiLane<T>,