Ngram class

can't commit to main repo so merging with my repo