Struct tongrams::trie_count_lm::TrieCountLm
source ·
[−]pub struct TrieCountLm<T, V, A> where
T: TrieArray,
V: Vocabulary,
A: RankArray, { /* private fields */ }
Expand description
Elias-Fano trie for indexing N-grams with their frequency counts.
Implementations
pub fn from_files<P>(filepaths: &[P], fmt: GramsFileFormats) -> Result<Self> where
P: AsRef<Path>,
pub fn from_files<P>(filepaths: &[P], fmt: GramsFileFormats) -> Result<Self> where
P: AsRef<Path>,
Builds the index from N-gram counts files.
Arguments
filepaths
: Paths of N-gram counts files that should be sorted by N = 1, 2, …fmt
: File format.
Builds the index from N-gram counts files in a plain text format.
Arguments
filepaths
: Paths of N-gram counts files that should be sorted by N = 1, 2, …
Builds the index from N-gram counts files in a gzip compressed format.
Arguments
filepaths
: Paths of N-gram counts files that should be sorted by N = 1, 2, …
Builds the index from N-gram counts files in a deflate compressed format.
Arguments
filepaths
: Paths of N-gram counts files that should be sorted by N = 1, 2, …
Builds the index from N-gram counts files in a zlib compressed format.
Arguments
filepaths
: Paths of N-gram counts files that should be sorted by N = 1, 2, …
Serializes the index into the writer.
Deserializes the index from the reader.
Gets the number of bytes to serialize the index.
Gets breakdowns of memory usages for components.
Makes the lookuper.
Gets the maximum of N.
Trait Implementations
impl<T: Debug, V: Debug, A: Debug> Debug for TrieCountLm<T, V, A> where
T: TrieArray,
V: Vocabulary,
A: RankArray,
impl<T: Debug, V: Debug, A: Debug> Debug for TrieCountLm<T, V, A> where
T: TrieArray,
V: Vocabulary,
A: RankArray,
impl<T: Default, V: Default, A: Default> Default for TrieCountLm<T, V, A> where
T: TrieArray,
V: Vocabulary,
A: RankArray,
impl<T: Default, V: Default, A: Default> Default for TrieCountLm<T, V, A> where
T: TrieArray,
V: Vocabulary,
A: RankArray,
Returns the “default value” for a type. Read more