N-Grams

N-Grams

NGrams.ngramsFunction.
ngrams(tokens, n; add_bos=true, bos=BOS, add_eos=true, eos=EOS)

Iterate over a sequence of n-grams (of length n) from tokens.

source
NGrams.unigramsFunction.
unigrams(tokens)

Return a sequence of unigrams from tokens.

source
NGrams.bigramsFunction.
bigrams(xs; bos="*BOS*", eos="*EOS*")

Iterate over a sequence of bigrams from xs.

source
NGrams.trigramsFunction.
trigrams(xs; bos="*BOS*", eos="*EOS*")

Iterate over a sequence of trigrams from xs.

source