Text.Ngram (Text v0.2.0) View Source

Compute ngrams and their counts from a given UTF8 string.

Computes ngrams for n in 2..7

Link to this section Summary

Functions

Returns a map of n-grams for a given text and n-gram size.

Link to this section Types

Specs

ngram_range() :: 2..7

Link to this section Functions

Specs

ngram(String.t(), ngram_range()) :: %{required(list()) => integer()}

Returns a map of n-grams for a given text and n-gram size.

The n-gram size is a minimum of 2 and a maximum of 7 with a default of 2.