Modules | Files | Inheritance Tree | Inheritance Graph | Name Index
module GNOME::Speech::Recognition
interface RuleAlternatives
Files: GNOME_Speech.idl
GNOME-Speech-Recognition-RuleAlternatives-inheritance GNOME-Speech-Recognition-Rule.html GNOME-Speech-SpeechObject.html Bonobo-Unknown.html
Operations Summary:
 voidinitWithSubRule(in Rule rule)
 voidinitWithTokenArray(in StringArray tokens)
 voidinitWithSubRuleArray(in RuleArray rules)
 voidinitWithSubRuleAndWeightArray(in RuleArray rules, in FloatArray weights) raises
 voidappend(in Rule rule)
RuleArraygetRules()
FloatArraygetWeights()
 voidsetRules(in RuleArray rules)
 voidsetWeights(in FloatArray weights) raises

Operations Inherited from Rule
copy, toString

Operations Inherited from Bonobo::Unknown
ref, unref, queryInterface

Operation Details:
 void initWithSubRule(in Rule rule)

Initializes a RuleAlternatives object containing a single sub-rule. The weights array is set to null.

Parameters:
rule - the sub-rule.


 void initWithTokenArray(in StringArray tokens)

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).

Parameters:
tokens - a set of alternative tokens.
See Also:
RuleName#VOID


 void initWithSubRuleArray(in RuleArray rules)

Initializes a RuleAlternatives object with an array of sub-rules. The weights are set to null.

Parameters:
rules - the set of alternative sub-rules.


 void initWithSubRuleAndWeightArray(in RuleArray rules, in FloatArray weights) raises (IllegalArgumentException)

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.

Parameters:
rules - the set of alternative sub-rules.
weights - set of weights for each rule or null.
See Also:
setWeights


 void append(in Rule rule)

Append a single rule to the set of alternatives. The weights are set to null.

Parameters:
rule - the rule to append.


RuleArray getRules()

Return the array of alternative sub-rules.

Return:
the array of alternative sub-rules.


FloatArray getWeights()

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.

Return:
the array of weights.


 void setRules(in RuleArray 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.

See Also:
setWeights


 void setWeights(in FloatArray weights) raises (IllegalArgumentException)

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.

Parameters:
weights - the array of weights.
See Also:
setRules