fixed naive bayes generate for ngram data