pub fn to_explicit(&self) -> (ExplicitSubwordVocab, HashMap<u64, usize>) {
        let mut ngram_index = HashMap::new();
        let SubwordVocab {
            words,
            indices: _,
            indexer,
            min_n,
            max_n,
        } = &self;

        for word in words.iter().map(Self::bracket) {
            for (ngram, idx) in word
                .subword_indices_with_ngrams(*min_n as usize, *max_n as usize, indexer)
                .filter_map(|(ngram, idx)| idx.map(|idx| (ngram, idx)))
            {
                ngram_index.entry(ngram.into()).or_insert(idx);
            }
        }
        let (indexer, mapping) = ExplicitIndexer::new_with_indices(ngram_index);
        (
            ExplicitSubwordVocab::new(words.to_owned(), *min_n, *max_n, indexer),
            mapping,
        )
    }
/// Convert the hash-based vocabulary to an Explicit Vocabulary.
///
/// N-grams in the range `(self.min_n..self.max_n)` are extracted from the words in the
/// vocabulary, each of these gets assigned an index from the `BucketIndexer` which is used to
/// determine the index in the explicit subword vocab.
///
/// The second item in the returned tuple holds the `bucket -> explicit_index` mapping for
/// all buckets hit by `self`.
Convert the hash-based vocabulary to an Explicit Vocabulary.
N-grams in the range `(self.min_n..self.max_n)` are extracted from the words in the
vocabulary, each of these gets assigned an index from the `BucketIndexer` which is used to
determine the index in the explicit subword vocab.

The second item in the returned tuple holds the `bucket -> explicit_index` mapping for
all buckets hit by `self`.
Convert the hash - based vocabulary to an Explicit Vocabulary . N - grams in the range ` ( self . min_n .. self . max_n ) ` are extracted from the words in the vocabulary each of these gets assigned an index from the ` BucketIndexer ` which is used to determine the index in the explicit subword vocab . The second item in the returned tuple holds the ` bucket - > explicit_index ` mapping for all buckets hit by ` self ` .
pub fn to_explicit(&self) -> (ExplicitSubwordVocab, HashMap<u64, usize>) {
        let mut ngram_index = HashMap::new();
        let SubwordVocab {
            words,
            indices: _,
            indexer,
            min_n,
            max_n,
        } = &self;
        for word in words.iter().map(Self::bracket) {
            for (ngram, idx) in word
                .subword_indices_with_ngrams(*min_n as usize, *max_n as usize, indexer)
                .filter_map(|(ngram, idx)| idx.map(|idx| (ngram, idx)))
            {
                ngram_index.entry(ngram.into()).or_insert(idx);
            }
        }
        let (indexer, mapping) = ExplicitIndexer::new_with_indices(ngram_index);
        (
            ExplicitSubwordVocab::new(words.to_owned(), *min_n, *max_n, indexer),
            mapping,
        )
    }
pub fn to_explicit ( & self ) -> ( ExplicitSubwordVocab , HashMap < u64 , usize > ) { let mut ngram_index = HashMap :: new ( ) ; let SubwordVocab { words , indices : _ , indexer , min_n , max_n , } = & self ; for word in words . iter ( ) . map ( Self :: bracket ) { for ( ngram , idx ) in word . subword_indices_with_ngrams ( * min_n as usize , * max_n as usize , indexer ) . filter_map ( | ( ngram , idx ) | idx . map ( | idx | ( ngram , idx ) ) ) { ngram_index . entry ( ngram . into ( ) ) . or_insert ( idx ) ; } } let ( indexer , mapping ) = ExplicitIndexer :: new_with_indices ( ngram_index ) ; ( ExplicitSubwordVocab :: new ( words . to_owned ( ) , * min_n , * max_n , indexer ) , mapping , ) }
Convert the hash-based vocabulary to an Explicit Vocabulary.
Convert the hash - based vocabulary to an Explicit Vocabulary .
&self
&self