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
|