essence v0.2.0 Essence.Ngrams

This module offers various utility functions for generating bi-grams, tri-grams, and n-grams for given textual elements.

Summary

Functions

Calculate a list of two consecutive token pairs (bi-grams) from the given token_list or Essence.Document

Calculate a list of n consecutive token sequences (n-grams) from the given token_list or Essence.Docuemnt

Calculate a list of three consecutive token triples (tri-grams) from the given token_list or Essence.Docuemnt

Functions

bigrams(token_list)

Calculate a list of two consecutive token pairs (bi-grams) from the given token_list or Essence.Document.

ngrams(token_list, n)

Calculate a list of n consecutive token sequences (n-grams) from the given token_list or Essence.Docuemnt.

trigrams(token_list)

Calculate a list of three consecutive token triples (tri-grams) from the given token_list or Essence.Docuemnt.