Implement statistics of unigrams and bigrams