gemseo / core / grammars

Show inherited members

factory module

A factory to instantiate a derived class of BaseGrammar.

class gemseo.core.grammars.factory.GrammarFactory[source]

Bases: BaseFactory

A factory of BaseGrammar.

Return type:

Any

create(class_name, name, **options)[source]

Create a grammar.

Parameters:
  • class_name (str) – The name of a class deriving from BaseGrammar.

  • name (str) – The name to be given to the grammar.

  • **options (Any) – The options to be passed to the initialization.

Returns:

The instance of the class.

Raises:

TypeError – If the class cannot be instantiated.

Return type:

BaseGrammar

failed_imports: dict[str, str]

The class names bound to the import errors.

property grammars: list[str]

The sorted names of the available grammars.