public class ProbContextFreeGrammar extends ProbContextSensitiveGrammar implements ProbabilisticGrammar
CNFGRAMMAR, CONTEXT_FREE, CONTEXT_SENSITIVE, PROB_CONTEXT_FREE, REGULAR, rules, terminals, type, UNRESTRICTED, vars| Constructor and Description |
|---|
ProbContextFreeGrammar() |
| 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 grammars (unrestricted and context-sens)
and this grammar's restrictions.
|
boolean |
addRules(java.util.List<Rule> ruleList)
Add a ruleList as the grammar's rule list if all rules in it pass
both the restrictions of the parent grammars (unrestricted and context-sens)
and this grammar's restrictions.
|
boolean |
leftDerivesRight(java.util.ArrayList<java.lang.String> lhs,
java.util.ArrayList<java.lang.String> rhs)
Test whether LHS -> RHS is a rule in the grammar.
|
boolean |
validRule(Rule r)
For a grammar rule to be valid in a context-free grammar,
all the restrictions of the parent grammars must hold, and the restriction
of the context-free grammar must hold.
|
addRulesisTerminal, isVariable, toString, updateVarsAndTerminals, updateVarsAndTerminals, validateRuleProbabilitiesclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitupdateVarsAndTerminals, updateVarsAndTerminals, validateRuleProbabilitiespublic boolean addRules(java.util.List<Rule> ruleList)
addRules in interface ProbabilisticGrammaraddRules in class ProbUnrestrictedGrammarpublic boolean addRule(Rule r)
addRule in interface ProbabilisticGrammaraddRule in class ProbContextSensitiveGrammarpublic boolean validRule(Rule r)
validRule in interface ProbabilisticGrammarvalidRule in class ProbContextSensitiveGrammarr - ( a rule )public boolean leftDerivesRight(java.util.ArrayList<java.lang.String> lhs,
java.util.ArrayList<java.lang.String> rhs)
lhs - rhs -