[−][src]Struct finalfrontier::SimpleVocab
Generic corpus vocabulary type.
Can be used as an input or output lookup.
Methods
impl<T> SimpleVocab<T> where
T: Hash + Eq + Clone + Ord,
[src]
T: Hash + Eq + Clone + Ord,
pub fn get<Q: ?Sized>(&self, context: &Q) -> Option<&CountedType<T>> where
T: Borrow<Q>,
Q: Hash + Eq,
[src]
T: Borrow<Q>,
Q: Hash + Eq,
Get a specific context
Trait Implementations
impl<T> Vocab for SimpleVocab<T> where
T: Hash + Eq,
[src]
T: Hash + Eq,
type VocabType = T
type Config = SimpleVocabConfig
fn config(&self) -> SimpleVocabConfig
[src]
fn idx<Q: ?Sized>(&self, key: &Q) -> Option<usize> where
Self::VocabType: Borrow<Q>,
Q: Hash + Eq,
[src]
Self::VocabType: Borrow<Q>,
Q: Hash + Eq,
fn discard(&self, idx: usize) -> f32
[src]
fn types(&self) -> &[CountedType<Self::VocabType>]
[src]
fn n_types(&self) -> usize
[src]
fn is_empty(&self) -> bool
[src]
fn len(&self) -> usize
[src]
impl From<SimpleVocab<String>> for VocabWrap
[src]
fn from(vocab: SimpleVocab<String>) -> VocabWrap
[src]
impl<T, S> From<VocabBuilder<SimpleVocabConfig, T>> for SimpleVocab<S> where
T: Hash + Eq + Into<S>,
S: Hash + Eq + Clone + Ord,
[src]
T: Hash + Eq + Into<S>,
S: Hash + Eq + Clone + Ord,
Constructs a SimpleVocab<S>
from a VocabBuilder<T>
where T: Into<S>
.
fn from(builder: VocabBuilder<SimpleVocabConfig, T>) -> Self
[src]
impl<T: Clone> Clone for SimpleVocab<T>
[src]
fn clone(&self) -> SimpleVocab<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl<T> Send for SimpleVocab<T> where
T: Send,
T: Send,
impl<T> Sync for SimpleVocab<T> where
T: Sync,
T: Sync,
impl<T> Unpin for SimpleVocab<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for SimpleVocab<T> where
T: UnwindSafe,
T: UnwindSafe,
impl<T> RefUnwindSafe for SimpleVocab<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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<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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,