compute Ngram on source terms