ISpGrammarBuilder::AddRuleTransition (Windows CE 5.0)
This method adds a rule (reference) transition from one grammar rule to another.
HRESULT AddRuleTransition(SPSTATEHANDLE hFromState,SPSTATEHANDLE hToState,SPSTATEHANDLE hRule,float Weight,const SPPROPERTYINFO* pPropInfo);
Parameters
hFromState
[in] Handle of the state at which the arc should originate.hToState
[in] Handle of the state at which the arc should terminate. If NULL the final arc will be to the terminal node (implicit) of the grammar rule.hRule
[in] Handle of any state of the rule to be called with this transition. Get the hRule using the ISpGrammarBuilder::GetRule call. To refer to a rule in another grammar, "import" that rule by callingISpGrammarBuilder::GetRule( ... , SPRF_Import, TRUE /*fCreatIfNotExist*/, ...)
.The following table shows the special transition handles for hRule.
Transition handle Description SPRULETRANS_WILDCARD <WILDCARD> transition SPRULETRANS_DICTATION <DICTATION> single word from dictation SPRULETRANS_TEXTBUFFER <TEXTBUFFER> transition Weight
[in] Value specifying the relative weight of the arc in case there are multiple arcs originating at the value specified by hFromState.pPropInfo
[in] Pointer to a SPPROPERTYINFO structure containing property name and value information that is associated with the arc.
Return Values
The following table shows the possible return values.
Value | Description |
---|---|
S_OK | Function completed successfully. |
E_INVALIDARG | At least one of the parameters is invalid. |
E_OUTOFMEMORY | Not enough memory to complete operation. |
FAILED(hr) | Appropriate error message. |
Requirements
OS Versions: Windows CE .NET 4.1 and later.
Header: Sapi.h, Sapi.idl.
Link Library: Sapilib.lib.
See Also
ISpGrammarBuilder | SAPI Interfaces
Send Feedback on this topic to the authors