ViterbiParser.__init__(grammar, trace=0)[source]

Create a new ViterbiParser parser, that uses grammar to parse texts.

  • grammar (PCFG) – The grammar used to parse texts.
  • trace (int) – The level of tracing that should be used when parsing a text. 0 will generate no tracing output; and higher numbers will produce more verbose tracing output.