concepts.language.neural_ccg.grammar.NeuralCCGConjSyntaxType#
- class NeuralCCGConjSyntaxType[source]#
Bases:
NeuralCCGSyntaxType
Data structure for conjunction syntax types. Conjunction syntax types are represented as a single string (stored in
return_type
.Methods
bapp
(lhs)Backward application composition.
compose
(rhs, composition_type)Compose this element with another element.
coord
(other)Coordination composition.
coord3
(lhs, rhs)Coordination composition with three elements.
derive_lang_syntax_type
(lang_syntax_type)Create a new syntax type that has an associated standard linguistic syntax type.
fapp
(rhs)Forward application composition.
iter_from_function
(function[, nr_used_arguments])Create all possible linearization of the corresponding function.
none
(rhs)None composition (composition with a None element).
Attributes
The arity of the syntax type.
Whether this element is a conjunction.
Whether the syntax type is a function type.
Whether this element is None.
Whether the syntax type is a value type.
The return type of the syntax type.
The argument types of the syntax.
The linearization of arguments.
Optionally, a
CCGSyntaxType
can be associated with theNeuralCCGSyntaxType
.- __call__(lhs, rhs)[source]#
Perform conjunction of two syntax types.
- Parameters:
lhs (NeuralCCGSyntaxType)
rhs (NeuralCCGSyntaxType)
- Return type:
- __new__(**kwargs)#
- bapp(lhs)#
Backward application composition.
- Parameters:
lhs (CCGComposable)
- Return type:
- compose(rhs, composition_type)#
Compose this element with another element. This function will call the corresponding composition function according to the composition type. Note that since the coordination composition has three arguments, this function will return a
CCGCoordinationImmNode
for the first two arguments in coordination composition.- Parameters:
rhs (CCGComposable | CCGCoordinationImmNode) – the right-hand side element.
composition_type (CCGCompositionType) – the composition type.
- Returns:
The composed element.
- Return type:
- coord(other)#
Coordination composition.
- Parameters:
other (CCGComposable | CCGCoordinationImmNode)
- Return type:
- coord3(lhs, rhs)#
Coordination composition with three elements.
- Parameters:
lhs (CCGComposable)
rhs (CCGComposable)
- Return type:
- derive_lang_syntax_type(lang_syntax_type)#
Create a new syntax type that has an associated standard linguistic syntax type.
- Parameters:
lang_syntax_type (CCGSyntaxType) – the syntax type.
- Returns:
A new
NeuralCCGSyntaxType
with the same signature and linearization, but with an associated standard linguistic syntax type.- Return type:
- fapp(rhs)#
Forward application composition.
- Parameters:
rhs (CCGComposable)
- Return type:
- classmethod iter_from_function(function, nr_used_arguments=None)#
Create all possible linearization of the corresponding function.
- Parameters:
- Yields:
all possible
NeuralCCGSyntaxType
derived from the given function signature.- Return type:
- none(rhs)#
None composition (composition with a None element).
- Parameters:
rhs (CCGComposable)
- Return type:
- property arity: int#
The arity of the syntax type. That is, the number of arguments it needs to combine before it becomes a primitive syntax type.
- property is_conj#
Whether this element is a conjunction.
- property is_function: bool#
Whether the syntax type is a function type. That is, whether it can do function application with another syntax type.
- property is_value: bool#
Whether the syntax type is a value type. That is, whether it is a primitive syntax type.
- lang_syntax_type: CCGSyntaxType | None#
Optionally, a
CCGSyntaxType
can be associated with theNeuralCCGSyntaxType
.
- linearization: Tuple[LinearizationTuple, ...]#
The linearization of arguments. See the docstring for details.
- return_type: str#
The return type of the syntax type. For conjunction syntax types, this is the string name of the conjunction.
- property typename#