public class ProbContextSensitiveGrammar extends ProbUnrestrictedGrammar implements ProbabilisticGrammar
CNFGRAMMAR, CONTEXT_FREE, CONTEXT_SENSITIVE, PROB_CONTEXT_FREE, REGULAR, rules, terminals, type, UNRESTRICTED, vars| Constructor and Description |
|---|
ProbContextSensitiveGrammar() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addRule(Rule r)
Add a rule to the grammar's rule list if it passes
both the restrictions of the parent grammar (unrestricted) and
this grammar's restrictions.
|
boolean |
addRules(java.util.ArrayList<Rule> ruleList)
Add a ruleList as the grammar's rule list if all rules in it pass
both the restrictions of the parent grammar (unrestricted) and
this grammar's restrictions.
|
boolean |
validRule(Rule r)
For a grammar rule to be valid in a context sensitive grammar,
all the restrictions of the parent grammar (unrestricted) must hold,
and the number of RHS symbols must be equal or greater than the number
of LHS symbols.
|
addRules, isTerminal, isVariable, toString, updateVarsAndTerminals, updateVarsAndTerminals, validateRuleProbabilitiesclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddRules, updateVarsAndTerminals, updateVarsAndTerminals, validateRuleProbabilitiespublic boolean addRules(java.util.ArrayList<Rule> ruleList)
public boolean addRule(Rule r)
addRule in interface ProbabilisticGrammaraddRule in class ProbUnrestrictedGrammarpublic boolean validRule(Rule r)
validRule in interface ProbabilisticGrammarvalidRule in class ProbUnrestrictedGrammarr - ( a rule )