factory module¶
A factory to instantiate a derived class of BaseGrammar
.
- class gemseo.core.grammars.factory.GrammarFactory[source]
Bases:
BaseFactory
[BaseGrammar
]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: