[][src]Trait finalfusion::subword::SubwordIndices

pub trait SubwordIndices<'a, 'b, I> where
    I: Indexer + 'b, 
{ type Iter: Iterator<Item = (&'a str, Option<u64>)>; fn subword_indices_with_ngrams(
        &'a self,
        min_n: usize,
        max_n: usize,
        indexer: &'b I
    ) -> Self::Iter; fn subword_indices(
        &'a self,
        min_n: usize,
        max_n: usize,
        indexer: &'b I
    ) -> Box<dyn Iterator<Item = u64> + 'a>
    where
        'b: 'a
, { ... } }

Trait returning iterators over subwords and indices.

Defines methods to iterate over the subwords and their corresponding indices as assigned through the given Indexer. The Indexer can allow collisions.

Associated Types

type Iter: Iterator<Item = (&'a str, Option<u64>)>

Loading content...

Required methods

fn subword_indices_with_ngrams(
    &'a self,
    min_n: usize,
    max_n: usize,
    indexer: &'b I
) -> Self::Iter

Return an iterator over the subwords and subword indices of a string.

The n-grams that are used are of length [min_n, max_n], these are mapped to indices using the given indexer.

Loading content...

Provided methods

fn subword_indices(
    &'a self,
    min_n: usize,
    max_n: usize,
    indexer: &'b I
) -> Box<dyn Iterator<Item = u64> + 'a> where
    'b: 'a, 

Return an iterator over the subword indices of a string.

The n-grams that are used are of length [min_n, max_n], these are mapped to indices using the given indexer.

Loading content...

Implementations on Foreign Types

impl<'a, 'b, I> SubwordIndices<'a, 'b, I> for str where
    I: Indexer + 'b, 
[src]

type Iter = NGramsIndicesIter<'a, 'b, I>

Loading content...

Implementors

Loading content...