Counts Frequencies and computes ngrams