concepts.language.ccg.syntax.CCGSyntaxSystem#

class CCGSyntaxSystem[source]#

Bases: object

A data structure that keeps track of a set of primitive and conjunction syntax types allowed in a grammar.

Methods

define_conj_type(stype)

Define a conj syntax type.

define_primitive_type(stype)

Define a primitive syntax type.

format_sumamry()

print_summary()

__getitem__(item)[source]#

A syntax sugar for parse_syntax_type.

  • When the string is None, return None.

  • When the string is a CCGSyntaxType, return the type itself.

Parameters:

item (CCGSyntaxType | str | None) – The string to be parsed.

Returns:

The parsed syntax type.

Return type:

CCGSyntaxType

__init__()[source]#
__new__(**kwargs)#
define_conj_type(stype)[source]#

Define a conj syntax type.

Parameters:

stype (CCGSyntaxType | str) – The syntax type to be defined.

define_primitive_type(stype)[source]#

Define a primitive syntax type.

Parameters:

stype (CCGSyntaxType | str) – The syntax type to be defined.

format_sumamry()[source]#
Return type:

str

print_summary()[source]#