class documentation

A probabilistic context free grammar production. A PCFG ProbabilisticProduction is essentially just a Production that has an associated probability, which represents how likely it is that this production will be used. In particular, the probability of a ProbabilisticProduction records the likelihood that its right-hand side is the correct instantiation for any given occurrence of its left-hand side.

See Also
Production
Method __eq__ Return True if this Production is equal to other.
Method __hash__ Return a hash value for the Production.
Method __init__ Construct a new ProbabilisticProduction.
Method __ne__ Undocumented
Method __str__ Return a verbose string representation of the Production.

Inherited from Production:

Method __len__ Return the length of the right-hand side.
Method __lt__ Undocumented
Method __repr__ Return a concise string representation of the Production.
Method is_lexical Return True if the right-hand contain at least one terminal token.
Method is_nonlexical Return True if the right-hand side only contains Nonterminals
Method lhs Return the left-hand side of this Production.
Method rhs Return the right-hand side of this Production.
Instance Variable _lhs The left-hand side of the production.
Instance Variable _rhs The right-hand side of the production.

Inherited from ImmutableProbabilisticMixIn (via Production):

Method set_logprob Set the log probability associated with this object to logprob. I.e., set the probability associated with this object to 2**(logprob).
Method set_prob Set the probability associated with this object to prob.

Inherited from ProbabilisticMixIn (via Production, ImmutableProbabilisticMixIn):

Method logprob Return log(p), where p is the probability associated with this object.
Method prob Return the probability associated with this object.
Instance Variable __logprob Undocumented
Instance Variable __prob Undocumented
def __eq__(self, other): (source)

Return True if this Production is equal to other.

Returns
boolUndocumented
def __hash__(self): (source)

Return a hash value for the Production.

Returns
intUndocumented
def __init__(self, lhs, rhs, **prob): (source)

Construct a new ProbabilisticProduction.

Parameters
lhs:NonterminalThe left-hand side of the new ProbabilisticProduction.
rhs:sequence(Nonterminal and terminal)The right-hand side of the new ProbabilisticProduction.
**probProbability parameters of the new ProbabilisticProduction.
def __ne__(self, other): (source)

Undocumented

def __str__(self): (source)

Return a verbose string representation of the Production.

Returns
strUndocumented