| Home | Trees | Indices | Help |
|
|---|
|
|
The lexicon is constructed by calling lexicon.parseLexicon(<lexicon string>). In order to construct a parser, you also need a rule set. The standard English rules are provided in chart as chart.DefaultRuleSet The parser can then be constructed by calling, for example: parser = chart.CCGChartParser(<lexicon>, <ruleset>) Parsing is then performed by running parser.nbest_parse(<sentence>.split()) While this returns a list of trees, the default representation of the produced trees is not very enlightening, particularly given that it uses the same tree class as the CFG parsers. It is probably better to call: chart.printCCGDerivation(<parse tree extracted from list>) which should print a nice representation of the derivation. This entire process is shown far more clearly in the demonstration: python chart.py
|
|||
| CCGEdge | |||
|
CCGLeafEdge Class representing leaf edges in a CCG derivation. |
|||
|
BinaryCombinatorRule Class implementing application of a binary combinator to a chart. |
|||
|
ForwardTypeRaiseRule Class for applying forward type raising |
|||
|
BackwardTypeRaiseRule Class for applying backward type raising. |
|||
|
CCGChartParser Chart parser for CCGs. |
|||
| CCGChart | |||
|
|||
|
|||
|
|||
|
|||
|
|||
ApplicationRuleSet = [BinaryCombinatorRule(ForwardApplication)
|
|||
CompositionRuleSet = [BinaryCombinatorRule(ForwardComposition)
|
|||
SubstitutionRuleSet = [BinaryCombinatorRule(ForwardSubstitutio
|
|||
TypeRaiseRuleSet = [ForwardTypeRaiseRule(), BackwardTypeRaiseR
|
|||
DefaultRuleSet = ApplicationRuleSet+ CompositionRuleSet+ Subst
|
|||
lex = lexicon.parseLexicon(
|
|||
|
|||
ApplicationRuleSet
|
CompositionRuleSet
|
SubstitutionRuleSet
|
TypeRaiseRuleSet
|
DefaultRuleSet
|
lex
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Mon Apr 11 14:39:40 2011 | http://epydoc.sourceforge.net |