add ngram class for word segmentation method