[−][src]Struct finalfusion::vocab::SubwordVocab
Vocabulary with subword units.
Methods
impl<I> SubwordVocab<I> where
I: Indexer,
[src]
I: Indexer,
pub fn new(
words: impl Into<Vec<String>>,
min_n: u32,
max_n: u32,
indexer: I
) -> Self
[src]
words: impl Into<Vec<String>>,
min_n: u32,
max_n: u32,
indexer: I
) -> Self
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]
fn clone(&self) -> SubwordVocab<I>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<I: Debug> Debug for SubwordVocab<I>
[src]
impl<I: Eq> Eq for SubwordVocab<I>
[src]
impl From<SubwordVocab<ExplicitIndexer>> for VocabWrap
[src]
fn from(v: ExplicitSubwordVocab) -> Self
[src]
impl From<SubwordVocab<FastTextIndexer>> for VocabWrap
[src]
fn from(v: FastTextSubwordVocab) -> Self
[src]
impl From<SubwordVocab<HashIndexer<FnvHasher>>> for VocabWrap
[src]
fn from(v: BucketSubwordVocab) -> Self
[src]
impl<I> NGramIndices for SubwordVocab<I> where
I: Indexer,
[src]
I: Indexer,
impl<I: PartialEq> PartialEq<SubwordVocab<I>> for SubwordVocab<I>
[src]
fn eq(&self, other: &SubwordVocab<I>) -> bool
[src]
fn ne(&self, other: &SubwordVocab<I>) -> bool
[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]
I: Indexer,
impl<I> Vocab for SubwordVocab<I> where
I: Indexer,
[src]
I: Indexer,
Auto Trait Implementations
impl<I> RefUnwindSafe for SubwordVocab<I> where
I: RefUnwindSafe,
I: RefUnwindSafe,
impl<I> Send for SubwordVocab<I> where
I: Send,
I: Send,
impl<I> Sync for SubwordVocab<I> where
I: Sync,
I: Sync,
impl<I> Unpin for SubwordVocab<I> where
I: Unpin,
I: Unpin,
impl<I> UnwindSafe for SubwordVocab<I> where
I: UnwindSafe,
I: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,