| Operations Summary: | |
| void | initWithSubRule(in Rule rule) |
| void | initWithTokenArray(in StringArray tokens) |
| void | initWithSubRuleArray(in RuleArray rules) |
| void | initWithSubRuleAndWeightArray(in RuleArray rules, in FloatArray weights) raises |
| void | append(in Rule rule) |
| RuleArray | getRules() |
| FloatArray | getWeights() |
| void | setRules(in RuleArray rules) |
| void | setWeights(in FloatArray weights) raises |
| Operations Inherited from Rule | |
| copy, toString | |
| Operations Inherited from Bonobo::Unknown | |
| ref, unref, queryInterface | |
| Operation Details: |
Initializes a RuleAlternatives object containing
a single sub-rule. The weights array is set to null.
Initializes for RuleAlternatives that produces a
phrase list from an array of strings. Each string is used to
create a single RuleToken object.
A string containing multiple words (e.g. "san francisco") is treated as a single token. If appropriate, an application should parse such strings to produce separate tokens.
The phrase list may be zero-length or null. This will produce an empty set of alternatives which is equivalent to <VOID> (i.e. unspeakable).
RuleName#VOID
Initializes a RuleAlternatives object with an
array of sub-rules. The weights are set to null.
Initializes a RuleAlternatives object with an array
of sub-rules and an array of weights. The rules array and weights
array may be null. If the weights array is non-null, it must have
identical length to the rules array.
setWeights Append a single rule to the set of alternatives. The weights are set to null.
Return the array of alternative sub-rules.
Return the array of weights. May return null. If non-null, the length of the weights array is guaranteed to be the same length as the array of rules.
Set the array of alternative sub-rules.
If the weights are non-null and the number of rules is
not equal to the number of weights, the weights are set to null.
To change the number of rules and weights, call
setRules before setWeights.
setWeights
Set the array of weights for the rules. The weights
array may be null. If the weights are null, then all
alternatives are assumed to be equally likely.
The length of the weights array must be the same length as the array of rules. The weights must all be greater than or equal to 0.0 and at least one must be non-zero.
To change the number of rules and weights, first call
setRules.
setRules