nltk.ccg.combinator module¶
CCG Combinators
- class nltk.ccg.combinator.BackwardCombinator[source]¶
Bases:
DirectedBinaryCombinator
The backward equivalent of the ForwardCombinator class.
- class nltk.ccg.combinator.DirectedBinaryCombinator[source]¶
Bases:
object
Wrapper 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:
DirectedBinaryCombinator
Class 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.UndirectedBinaryCombinator[source]¶
Bases:
object
Abstract 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.UndirectedComposition[source]¶
Bases:
UndirectedBinaryCombinator
Functional 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.UndirectedFunctionApplication[source]¶
Bases:
UndirectedBinaryCombinator
Class representing function application. Implements rules of the form: X/Y Y -> X (>) And the corresponding backwards application rule
- class nltk.ccg.combinator.UndirectedSubstitution[source]¶
Bases:
UndirectedBinaryCombinator
Substitution (permutation) combinator. Implements rules of the form Y/Z (XY)/Z -> X/Z (<Sx) And other variations.
- class nltk.ccg.combinator.UndirectedTypeRaise[source]¶
Bases:
UndirectedBinaryCombinator
Undirected combinator for type raising.