ISpSREngineSite::GetRuleInfo (SAPI 5.4)
Microsoft Speech API 5.4
ISpSREngineSite::GetRuleInfo
ISpSREngineSite::GetRuleInfo retrieves information about a CFG rule.
HRESULT GetRuleInfo(SPRULEENTRY *pRuleEntry,
SPRULEINFOOPT Options
);
Parameters
- pRuleEntry
[in, out] Address of the SPRULEENTRY structure that contains the grammar rule entry information. - Options
[in] One of the grammar rule options specified in the SPRULEINFOOPT enumeration sequence. (This should always be set to SPRIO_NONE).
Return values
Value |
S_OK |
E_POINTER |
E_INVALIDARG |
FAILED (hr) |
Remarks
This method can be called after the engine has been informed of a rule with the ISpSREngine::RuleNotify method. This method can be used to recover rule information from the rule handle. Only the hRule rule handle field in the SPRULEENTRY needs to be filled in by the engine when calling this method. The engine will fill in:
- The pvClientRuleContext, which is a pointer that the engine can set using ISpSREngineSite::SetRuleClientContext.
- The pvClientGrammarContext, which is the pointer that the engine set in the ISpSREngine::OnCreateGrammar method. This indicates which grammar the rule belongs to.
- The Attributes field, of type SPCFGRULEATTRIBUTES, which contains some flags giving extra information about the rule:
SPRAF_TopLevel if the rule is top-level and thus can be activated for recognition. |
SPRAF_Interpreter if the rule is associated with an Interpreter object for semantic processing. |
SPRAF_AutoPause if the rule is auto-pause. |
- The hInitialState field, which gives the initial state of the rule. Information on this and subsequent states can be obtained by calling the ISpSREngineSite::GetStateInfo method.