nltk.parse.RandomChartParser.__init__

RandomChartParser.__init__(grammar, beam_size=0, trace=0)

Create a new BottomUpProbabilisticChartParser, that uses grammar to parse texts.

Parameters:
  • grammar (PCFG) – The grammar used to parse texts.
  • beam_size (int) – The maximum length for the parser’s edge queue.
  • 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.