concepts.language.ccg.search.CCGSyntaxEnumerativeSearcher#

class CCGSyntaxEnumerativeSearcher[source]#

Bases: CCGSyntaxSearcherBase

Enumerative searcher for syntax types.

Methods

gen([max_depth, allow_functor_type])

Generate a list of candidate syntax types.

Attributes

syntax_system

The syntax system.

__init__(syntax_system, starting_symbols=('S',))[source]#

Initialize the searcher.

Parameters:
  • syntax_system (CCGSyntaxSystem) – the syntax system, containing all primitive and conjunction syntax types.

  • starting_symbols (Iterable[str]) – the root primitive symbol for candidate syntax types.

__new__(**kwargs)#
gen(max_depth=3, allow_functor_type=False)[source]#

Generate a list of candidate syntax types.

Parameters:
  • max_depth (int) – The maximum depth of the syntax tree.

  • allow_functor_type (bool) – Whether to allow functor types during composition. When this is set to False, the function will not generate any syntax types that contains functor-typed arguments. For example S/(NP/NP).

Returns:

A list of candidate syntax types.

Return type:

List[CCGSyntaxSearchResult]

property syntax_system#

The syntax system.