[−][src]Struct finalfusion::subword::ExplicitIndexer
Indexer for explicitly stored NGrams.
Methods
impl ExplicitIndexer
[src]
impl ExplicitIndexer
[src]
pub fn new(ngrams: impl Into<Vec<String>>) -> Self
[src]
Construct a new explicit indexer.
Panics when there are duplicate ngrams.
pub fn new_with_indices(ngram_tuples: Vec<(String, u64)>) -> Self
[src]
Construct a new explicit indexer with given indices.
The (String, u64)
tuples resemble the original subword -> index
mapping. This mapping
does not need to be perfect, i.e. multiple subwords can map to the same index as it is
common with bucketed indexing.
This constructor numbers the original indices as they appear and assigns a new index
accordingly. After construction, subwords that originally had the same index will still be
indexed by a common number. It is guaranteed that the new indices cover
(0..n_original_indices)
where n_original_indices
is the number of unique indices in the
subword -> index
mapping.
Panics when there are duplicate ngrams.
Trait Implementations
impl Clone for ExplicitIndexer
[src]
fn clone(&self) -> ExplicitIndexer
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ExplicitIndexer
[src]
impl Eq for ExplicitIndexer
[src]
impl Indexer for ExplicitIndexer
[src]
fn index_ngram(&self, ngram: &StrWithCharLen) -> Option<u64>
[src]
fn upper_bound(&self) -> u64
[src]
fn infallible() -> bool
[src]
impl PartialEq<ExplicitIndexer> for ExplicitIndexer
[src]
fn eq(&self, other: &ExplicitIndexer) -> bool
[src]
fn ne(&self, other: &ExplicitIndexer) -> bool
[src]
impl StructuralEq for ExplicitIndexer
[src]
impl StructuralPartialEq for ExplicitIndexer
[src]
Auto Trait Implementations
impl RefUnwindSafe for ExplicitIndexer
impl Send for ExplicitIndexer
impl Sync for ExplicitIndexer
impl Unpin for ExplicitIndexer
impl UnwindSafe for ExplicitIndexer
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>,