concepts.language.ccg.composition.CCGCompositionSystem#

class CCGCompositionSystem[source]#

Bases: object

The CCG composition system. It keeps track of the rules that can be used for composition.

Methods

format_summary()

Format the summary of the composition system.

make_categorial_grammar()

Make the CCG composition system that allows function application and coordination (i.e., categorial grammar).

make_default()

Make the default CCG composition system.

make_function_application()

Make the CCG composition system that only allows function application.

print_summary()

Print the summary of the composition system.

try_compose(lhs, rhs)

Try to compose two elements.

Attributes

__init__(name, weights)[source]#

Initialize the CCG composition system.

Parameters:
__new__(**kwargs)#
format_summary()[source]#

Format the summary of the composition system.

Return type:

str

classmethod make_categorial_grammar()[source]#

Make the CCG composition system that allows function application and coordination (i.e., categorial grammar).

Return type:

CCGCompositionSystem

classmethod make_default()[source]#

Make the default CCG composition system.

Return type:

CCGCompositionSystem

classmethod make_function_application()[source]#

Make the CCG composition system that only allows function application.

Return type:

CCGCompositionSystem

print_summary()[source]#

Print the summary of the composition system.

try_compose(lhs, rhs)[source]#

Try to compose two elements. This function will try to compose the two elements with all allowed composition types, and return the result that works.

Parameters:
Returns:

The composition result.

Return type:

CCGCompositionResult

property allowed_composition_types#