improvements to ngram parser (mode ngram types)