| Home | Trees | Indices | Help |
|
|---|
|
|
Data classes and parser implementations for "chart parsers", which use dynamic programming to efficiently parse a text. A chart parser derives parse trees for a text by iteratively adding "edges" to a "chart." Each edge represents a hypothesis about the tree structure for a subsequence of the text. The chart is a "blackboard" for composing and combining these hypotheses.
When a chart parser begins parsing a text, it creates a new (empty) chart, spanning the text. It then incrementally adds new edges to the chart. A set of chart rules specifies the conditions under which new edges should be added to the chart. Once the chart reaches a stage where none of the chart rules adds any new edges, parsing is complete.
Charts are encoded with the Chart class, and edges are encoded with the TreeEdge and LeafEdge classes. The chart parser module defines three chart parsers:
ChartParser is a simple and flexible chart parser.
Given a set of chart rules, it will apply those rules to the chart
until no more edges are added.
SteppingChartParser is a subclass of
ChartParser that can be used to step through the parsing
process.
|
|||
|
EdgeI A hypothesis about the structure of part of a sentence. |
|||
|
TreeEdge An edge that records the fact that a tree is (partially) consistent with the sentence. |
|||
|
LeafEdge An edge that records the fact that a leaf value is consistent with a word in the sentence. |
|||
|
Chart A blackboard for hypotheses about the syntactic constituents of a sentence. |
|||
|
ChartRuleI A rule that specifies what new edges are licensed by any given set of existing edges. |
|||
|
AbstractChartRule An abstract base class for chart rules. |
|||
|
FundamentalRule A rule that joins two adjacent edges to form a single combined edge. |
|||
|
SingleEdgeFundamentalRule A rule that joins a given edge with adjacent edges in the chart, to form combined edges. |
|||
| LeafInitRule | |||
|
TopDownInitRule A rule licensing edges corresponding to the grammar productions for the grammar's start symbol. |
|||
|
TopDownPredictRule A rule licensing edges corresponding to the grammar productions for the nonterminal following an incomplete edge's dot. |
|||
|
CachedTopDownPredictRule A cached version of TopDownPredictRule. |
|||
|
BottomUpPredictRule A rule licensing any edge corresponding to a production whose right-hand side begins with a complete edge's left-hand side. |
|||
|
BottomUpPredictCombineRule A rule licensing any edge corresponding to a production whose right-hand side begins with a complete edge's left-hand side. |
|||
|
EmptyPredictRule A rule that inserts all empty productions as passive edges, in every position in the chart. |
|||
| FilteredSingleEdgeFundamentalRule | |||
| FilteredBottomUpPredictCombineRule | |||
|
ChartParser A generic chart parser. |
|||
|
TopDownChartParser A ChartParser using a top-down parsing strategy. |
|||
|
BottomUpChartParser A ChartParser using a bottom-up parsing strategy. |
|||
|
BottomUpLeftCornerChartParser A ChartParser using a bottom-up left-corner parsing strategy. |
|||
| LeftCornerChartParser | |||
|
SteppingChartParser A ChartParser that allows you to step through the
parsing process, adding a single edge at a time.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
TD_STRATEGY = [LeafInitRule(), TopDownInitRule(), CachedTopDow
|
|||
BU_STRATEGY = [LeafInitRule(), EmptyPredictRule(), BottomUpPre
|
|||
BU_LC_STRATEGY = [LeafInitRule(), EmptyPredictRule(), BottomUp
|
|||
LC_STRATEGY = [LeafInitRule(), FilteredBottomUpPredictCombineR
|
|||
|
|||
TD_STRATEGY
|
BU_STRATEGY
|
BU_LC_STRATEGY
|
LC_STRATEGY
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Mon Apr 11 14:39:42 2011 | http://epydoc.sourceforge.net |