SRCFGSYMBOL

typedef struct {
WORD wType;
WORD wProbability;
DWORD dwValue;
} SRCFGSYMBOL;

Defines a symbol in a context-free grammar. Each symbol corresponds to an element of a rule.

wType

Symbol type. This member can be one of these values:

Value

Meaning

SRCFG_ENDOPERATION

The end of an operation — for example, ")". The ending of the type of operation specified by the dwValue member.

SRCFG_LIST

A list identifier. Includes a list of words created at run time, identified by the unique list identifier in the dwValue member. The list identifier is specific to the current grammar. The run-time list name can be found in the SRCFGLIST structures stored in the context-free grammar. (May not be supported by all engines.)

SRCFG_RULE

Another rule — for example, "<Names>" A rule is identified by the unique rule identifier in the dwValue member. The identifier is unique for the current grammar.

SRCFG_STARTOPERATION

The beginning of an operation — for example, "ALT(". Everything from here to the ENDOPERATION type is included in the operation specified by the dwValue member. Several occurrences of the same operation type might be contained within this operation.

SRCFG_WILDCARD

Indicates that the engine should accept any amount of verbal input until the next word (specified by SRCFG_WORD) is heard. (May not be supported by all engines.)

SRCFG_WORD

A word — for example, "Bill." A word is identified by the unique word identifier in the dwValue member. The identifier is unique for the current grammar.


The SRCFG_WILDCARD value allows an engine to do a hybrid of word spotting and continuous recognition. For example, a grammar could have "{wild-card} mail {wild-card} <name>" which would allow the user to say "Send mail to Fred," "I want to mail Fred," or even "Mail, yes, I want it to go to Fred." An engine indicates that it supports wildcards by setting the SRFEATURE_WILDCARD flag.

wProbability

Value that indicates a probability that the specific path will be taken, given past experiences. This parameter is valid only for words and rules in a branching operation. This is not on a fixed scale, but the meaning of this member depends upon the other wProbability values within the operation.

The probability of the speaker taking the action can be computed by adding up all of the wProbability values for the operation and dividing that into the wProbability value of an individual word or rule. If the sum of all wProbability values is 0, then all branches are equally probable.

dwValue

Value of the wType member. If wType is SRCFG_STARTOPERATION or SRCFG_ENDOPERATION, dwValue can be one of these values:

Value

Meaning

SRCFGO_ALTERNATIVE

One of the operands must be spoken.

SRCFGO_OPTIONAL

The operand is optional and might not be spoken by the speaker. This can contain only one operand.

SRCFGO_REPEAT

The operand can be spoken by the speaker one or more times. This can contain only one operand.

SRCFGO_SEQUENCE

The operands must be spoken in the given order for the rule to be traversed.


For other wType values, dwValue can be one of these values:

Value

Meaning

SRCFG_LIST

The grammar's unique identifier for the list.

SRCFG_RULE

The grammar's unique identifier for the rule.

SRCFG_WORD

The grammar's unique identifier for the word.