Package jazzparser :: Package evaluation :: Module parsing
[hide private]
[frames] | no frames]

Module parsing

source code

Evaluation tools for evaluating the parsing process.

Once upon a time, this was a handy interface to supertagging and parsing that made it easy to write evaluation routines. Nowadays, the main parse script is much more capable and the interface to the parsers is much cleaner anyway.

The only thing left here now is parse_sequence_with_annotations


Author: Mark Granroth-Wilding <mark.granroth-wilding@ed.ac.uk>

Functions [hide private]
 
parse_sequence_with_annotations(sequence, grammar, logger=None, allow_subparses=True, popts={}, parse_logger=None)
Parses an annotated sequence.
source code
Variables [hide private]
  __package__ = 'jazzparser.evaluation'
Function Details [hide private]

parse_sequence_with_annotations(sequence, grammar, logger=None, allow_subparses=True, popts={}, parse_logger=None)

source code 

Parses an annotated sequence. This is essentially just constructing the implicit derivation encoded in the annotations (categories and coordination markers) and returning the top-level result that this derivation yields.

If there are missing annotations, this will not yield a single result, but the results of each parse of a subsequence.

Returns a list of parse results. If the annotation is complete, the return value should be a single-item list containing the parse result.

Parameters:
  • allow_subparses (boolean) - if True (default) will return multiple subparses if the annotation is incomplete. If False, raises a ParseError in this case.
  • popts (dict) - options to pass to the parser
  • parse_logger (bool) - logger to which to report a trace of the shift-reduce parse of the annotations. If None, nothing is output