udpate method outputVoca and outputGrammar