concepts.language.ccg.composition.CCGComposable#

class CCGComposable[source]#

Bases: object

The basic class for composable elements (including syntax and semantics) for CCG.

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.

fapp(rhs)

Forward application composition.

none(rhs)

None composition (composition with a None element).

Attributes

is_conj

Whether this element is a conjunction.

is_none

Whether this element is None.

__init__()#
__new__(**kwargs)#
bapp(lhs)[source]#

Backward application composition.

Parameters:

lhs (CCGComposable) –

Return type:

CCGComposable

compose(rhs, composition_type)[source]#

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:
Returns:

The composed element.

Return type:

CCGComposable | CCGCoordinationImmNode

coord(other)[source]#

Coordination composition.

Parameters:

other (CCGComposable | CCGCoordinationImmNode) –

Return type:

CCGComposable | CCGCoordinationImmNode

coord3(lhs, rhs)[source]#

Coordination composition with three elements.

Parameters:
Return type:

CCGComposable

fapp(rhs)[source]#

Forward application composition.

Parameters:

rhs (CCGComposable) –

Return type:

CCGComposable

none(rhs)[source]#

None composition (composition with a None element).

Parameters:

rhs (CCGComposable) –

Return type:

CCGComposable

property is_conj: bool#

Whether this element is a conjunction.

property is_none: bool#

Whether this element is None.