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.
- __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:
- __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.