add grammarScore.applymethod for scala to call