Function calculate_frequencies calculates the number of times (not yet the relative frequency) for an ngram in the database (filtering, if need, by group or disease)
Functions to calculate total number of n-grams for the whole corpus and each group and disease