A grammar consists of a start state and a set of productions. The set
of terminals and nonterminals is implicitly specified by the
productions.
|
|
__init__(self,
start,
productions)
Create a new feature-based grammar, from the given start state and
set of Productions. |
source code
|
|
|
|
|
list of Production
|
productions(self,
lhs=None,
rhs=None,
empty=False)
Return the grammar productions, filtered by the left-hand side or the
first item in the right-hand side. |
source code
|
|
set of Nonterminal
|
|
set of Nonterminal
|
|
|
|
_get_type_if_possible(self,
item)
Helper function which returns the TYPE feature of the
item, if it exists, otherwise it returns the
item itself |
source code
|
|
|
Inherited from ContextFreeGrammar:
__repr__,
__str__,
check_coverage,
is_binarised,
is_chomsky_normal_form,
is_flexible_chomsky_normal_form,
is_leftcorner,
is_lexical,
is_nonempty,
is_nonlexical,
max_len,
min_len,
start
|