Package jazzparser :: Package parsers :: Package cky :: Module parser :: Class CkyParser
[hide private]
[frames] | no frames]

Class CkyParser

source code

        object --+    
                 |    
base.parser.Parser --+
                     |
                    CkyParser
Known Subclasses:

CkyParser is the central class for the jazz chord sequence recogniser parsing mechanism. It constitutes the "algorithm" module of the system. It begins with a set of signs assigned to the input by the tagger and parses to produce a chart, from which the resultant signs can be extracted.

Instance Methods [hide private]
 
_create_chart(self, *args, **kwargs) source code
list of tuples
_add_signs(self, offset=0, prob_adder=None)
Adds new signs to the chart from the supertagger, using the given offset when requesting them from the tagger.
source code
 
parse(self, derivations=False, summaries=False, inspect=False)
Run the parser on the input, using the specified tagger.
source code

Inherited from base.parser.Parser: __init__, run_backoff

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]

Inherited from base.parser.Parser: check_options

Class Variables [hide private]
  shell_tools = [ChartTool(), InteractiveChartTool(),]
  PARSER_OPTIONS = Parser.PARSER_OPTIONS+ [ModuleOption('max_ite...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_add_signs(self, offset=0, prob_adder=None)

source code 

Adds new signs to the chart from the supertagger, using the given offset when requesting them from the tagger.

Returns: list of tuples
all the signs that were actually added. Each is represented by a tuple (start_node, end_node, sign)

parse(self, derivations=False, summaries=False, inspect=False)

source code 

Run the parser on the input, using the specified tagger. Runs the CKY parsing algorithm to do chart parsing. For details of chart parsing, see Chart class.

If the parser was given a maximum number of iterations, the routine will return as usual after this number is completed, even if no parses have been found.

Parameters:
  • derivations (bool) - store derivation traces, which can subsequently be used to trace all the derivations that led to any given sign in the chart. Overridden by the module option if it's given
  • summaries (int/bool) - output chart summary information to stderr during parsing to track progress. Set to 2 to output some info, but not the full chart.
  • inspect (bool) - launch a graphical chart inspector during the parse to display interactive chart information.
Returns:
a list of signs that span the full input.
Overrides: base.parser.Parser.parse

Class Variable Details [hide private]

PARSER_OPTIONS

Value:
Parser.PARSER_OPTIONS+ [ModuleOption('max_iter', filter= int, help_tex\
t= "Maximum number of parser iterations to perform " "before giving up\
. If 0 or unspecified, continues " "until parse is complete.", usage= \
"max_iter=X, where X is an integer.", default= 0,), ModuleOption('min_\
iter', filter= int, help_text= "Usually, the parser will stop as soon \
as it finds a " "full parse. Use min_iter to make it continue parsing \
until " "it has done min_iter iterations or the tagger has ceased to "\
 "return any categories. Use -1 to keep going until the tagger " "give\
...