public class ProbCNFGrammar extends ProbContextFreeGrammar
CNFGRAMMAR, CONTEXT_FREE, CONTEXT_SENSITIVE, PROB_CONTEXT_FREE, REGULAR, rules, terminals, type, UNRESTRICTED, vars| Constructor and Description |
|---|
ProbCNFGrammar() |
ProbCNFGrammar(ProbCNFGrammar grammar) |
| 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 Context-free grammar, and the rule is
in Chomsky Normal Form.
|
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 Context-free grammar, and all rules
or in Chomsky-Normal-Form
|
boolean |
validRule(Rule r)
For a grammar rule to be valid in a context-free grammar,
all the restrictions of the context-free grammar must hold,
and the rule must be in one of three forms.
|
leftDerivesRightaddRulesisTerminal, isVariable, toString, updateVarsAndTerminals, updateVarsAndTerminals, validateRuleProbabilitiesclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitupdateVarsAndTerminals, updateVarsAndTerminals, validateRuleProbabilitiespublic ProbCNFGrammar()
public ProbCNFGrammar(ProbCNFGrammar grammar)
public boolean addRules(java.util.List<Rule> ruleList)
addRules in interface ProbabilisticGrammaraddRules in class ProbContextFreeGrammarpublic boolean addRule(Rule r)
addRule in interface ProbabilisticGrammaraddRule in class ProbContextFreeGrammarpublic boolean validRule(Rule r)
validRule in interface ProbabilisticGrammarvalidRule in class ProbContextFreeGrammarr, - a rule