Originally Posted by Lyncher:
In javax.speech.recognition.RuleGrammar's JavaDoc there is the following sentence: "An exception is thrown at that time is the named Rule is not found." "If no such rule exists, a GrammarException is issued during resume."
But in method declaration there's no "throws" clause defined.
In addRule (Rule rule) the sam problem exists. There's "GrammarException is issued if rule is null or not valid" but theres also no exception declared in method
RuleGrammar.removeRule Javadoc
Originally Posted by Lyncher:
In the javadoc of RuleGrammar.remove.Rule method there is the following statement: "If the ruleName corresponds to the root Rule, then the next PUBLIC_SCOPE Rule is used as the root Rule"
What is the "next" rule in the RuleGrammar? What is the expected underlying sorting strategy (the adding order, alphabetical ordering....)
Solved
Orginally Posted by Lyncher:
Found the answer in RuleGrammar.setRoot: "If the root rulename is not explicitly set with setRoot, then it defaults to the name of the first PUBLIC_SCOPE Rule added."
This means that the order that rules are added must be preserved.