Reference

Class

RiGrammar

Name

hasRule

Description Returns true if the requested rule exists in the grammar, else false
Syntax
hasRule(ruleName);
Parameters
Stringthe rule name
Returns
booleantrue if the rule exists in the grammar, else false
Example
rg = new RiGrammar(); 
rg.addRule("<start>", "the <action> of the <pet>", 1);
rg.addRule("<pet>", "dog | hawk | crow", 1);
rg.addRule("<action>", "cries | screams | falls", 1);
rg.hasRule("<action>") // true
Platform Java / Javascript