Skip to main content

skip_bigrams

Function skip_bigrams 

Source
pub fn skip_bigrams<'a>(
    tokens: &[&'a str],
    skip: usize,
) -> Vec<(&'a str, &'a str)>
Expand description

Generate skip-grams (n-grams with gaps).

A skip-gram of order (n, k) takes n tokens with up to k skips. This implementation generates bigrams with a given skip distance.