module documentation

Data classes and parser implementations for incremental 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.

A parser is "incremental", if it guarantees that for all i, j where i < j, all edges ending at i are built before any edges ending at j. This is appealing for, say, speech recognizer hypothesis filtering.

The main parser class is EarleyChartParser, which is a top-down algorithm, originally formulated by Jay Earley (1970).

Class CompleteFundamentalRule Undocumented
Class CompleterRule Undocumented
Class EarleyChartParser Undocumented
Class FeatureCompleteFundamentalRule Undocumented
Class FeatureCompleterRule Undocumented
Class FeatureEarleyChartParser Undocumented
Class FeatureIncrementalBottomUpChartParser Undocumented
Class FeatureIncrementalBottomUpLeftCornerChartParser Undocumented
Class FeatureIncrementalChart Undocumented
Class FeatureIncrementalChartParser Undocumented
Class FeatureIncrementalTopDownChartParser Undocumented
Class FeaturePredictorRule Undocumented
Class FeatureScannerRule Undocumented
Class FilteredCompleteFundamentalRule Undocumented
Class IncrementalBottomUpChartParser Undocumented
Class IncrementalBottomUpLeftCornerChartParser Undocumented
Class IncrementalChart Undocumented
Class IncrementalChartParser An incremental chart parser implementing Jay Earley's parsing algorithm:
Class IncrementalLeftCornerChartParser Undocumented
Class IncrementalTopDownChartParser Undocumented
Class PredictorRule Undocumented
Class ScannerRule Undocumented
Function demo A demonstration of the Earley parsers.
Constant BU_INCREMENTAL_FEATURE_STRATEGY Undocumented
Constant BU_INCREMENTAL_STRATEGY Undocumented
Constant BU_LC_INCREMENTAL_FEATURE_STRATEGY Undocumented
Constant BU_LC_INCREMENTAL_STRATEGY Undocumented
Constant EARLEY_FEATURE_STRATEGY Undocumented
Constant EARLEY_STRATEGY Undocumented
Constant LC_INCREMENTAL_STRATEGY Undocumented
Constant TD_INCREMENTAL_FEATURE_STRATEGY Undocumented
Constant TD_INCREMENTAL_STRATEGY Undocumented
def demo(print_times=True, print_grammar=False, print_trees=True, trace=2, sent='I saw John with a dog with my cookie', numparses=5): (source)

A demonstration of the Earley parsers.

BU_INCREMENTAL_STRATEGY = (source)
EARLEY_STRATEGY = (source)