Skip to main content

max_sparse_grams

Function max_sparse_grams 

Source
pub const fn max_sparse_grams(content_len: usize) -> usize
Expand description

Returns the maximum number of sparse n-grams that can be produced from content_len bytes of input. Use this to reserve capacity for the output (e.g. a Vec the emit closure pushes into, or a pre-sized slice it writes).