nltk.ccg.combinator module¶
CCG Combinators
- class nltk.ccg.combinator.UndirectedBinaryCombinator[source]¶
Bases:
objectAbstract class for representing a binary combinator. Merely defines functions for checking if the function and argument are able to be combined, and what the resulting category is.
Note that as no assumptions are made as to direction, the unrestricted combinators can perform all backward, forward and crossed variations of the combinators; these restrictions must be added in the rule class.
- class nltk.ccg.combinator.DirectedBinaryCombinator[source]¶
Bases:
objectWrapper for the undirected binary combinator. It takes left and right categories, and decides which is to be the function, and which the argument. It then decides whether or not they can be combined.
- class nltk.ccg.combinator.ForwardCombinator[source]¶
Bases:
DirectedBinaryCombinatorClass representing combinators where the primary functor is on the left.
Takes an undirected combinator, and a predicate which adds constraints restricting the cases in which it may apply.
- class nltk.ccg.combinator.BackwardCombinator[source]¶
Bases:
DirectedBinaryCombinatorThe backward equivalent of the ForwardCombinator class.
- class nltk.ccg.combinator.UndirectedFunctionApplication[source]¶
Bases:
UndirectedBinaryCombinatorClass representing function application. Implements rules of the form: X/Y Y -> X (>) And the corresponding backwards application rule
- class nltk.ccg.combinator.UndirectedComposition[source]¶
Bases:
UndirectedBinaryCombinatorFunctional composition (harmonic) combinator. Implements rules of the form X/Y Y/Z -> X/Z (B>) And the corresponding backwards and crossed variations.
- class nltk.ccg.combinator.UndirectedSubstitution[source]¶
Bases:
UndirectedBinaryCombinatorSubstitution (permutation) combinator. Implements rules of the form Y/Z (XY)/Z -> X/Z (<Sx) And other variations.
- class nltk.ccg.combinator.UndirectedTypeRaise[source]¶
Bases:
UndirectedBinaryCombinatorUndirected combinator for type raising.