factory module¶
A factory to instantiate a derived class of AbstractGrammar
.
Classes:
A factory of |
- class gemseo.core.grammars.factory.GrammarFactory[source]¶
Bases:
object
A factory of
AbstractGrammar
.Methods:
create
(class_name, name, **options)Create a grammar.
is_available
(class_name)Return whether a grammar class exists.
Attributes:
The sorted names of the available grammars.
- Return type
None
- create(class_name, name, **options)[source]¶
Create a grammar.
- Parameters
class_name (str) – The name of a class deriving from
AbstractGrammar
.name (str) – The name to be given to the grammar.
**options – The options to be passed to the initialization.
- Return type
- property grammars¶
The sorted names of the available grammars.
- is_available(class_name)[source]¶
Return whether a grammar class exists.
- Parameters
class_name – The name of a class deriving from
AbstractGrammar
.- Returns
Whether the grammar class exists.
- Return type
bool