yacc grammar handles n-gram features