Note

Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.

Microsoft Speech Platform

SPCFGRULEATTRIBUTES

SPCFGRULEATTRIBUTES indicates the attributes of grammar rules, such as whether the rule is top-level, active, and so forth.

<pre IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml"> <strong>typedef enum SPCFGRULEATTRIBUTES</strong> <strong>{</strong> <strong>SPRAF_TopLevel,</strong> <strong>SPRAF_Active,</strong> <strong>SPRAF_Export,</strong> <strong>SPRAF_Import,</strong> <strong>SPRAF_Interpreter,</strong> <strong>SPRAF_Dynamic,</strong> <strong>SPRAF_Root,</strong> <strong>SPRAF_AutoPause,</strong> <strong>SPRAF_UserDelimited</strong> <strong>} SPCFGRULEATTRIBUTES</strong>; </pre>

Elements

  • SPRAF_TopLevel
    Flag specifying that the rule is defined as a top-level rule. Top-level rules are the entry points into the grammar and can be activated and deactivated programmatically.
  • SPRAF_Active
    Flag specifying that the rule is defined as a top-level rule that is activated by default.
  • SPRAF_Export
    Flag specifying that the rule is exported and hence can be referred to by a rule in another grammar.
  • SPRAF_Import
    Flag specifying that the rule is imported from another grammar and is therefore not defined in this grammar.
  • SPRAF_Interpreter
    Flag specifying that the rule has an interpreter associated with it.
  • SPRAF_Dynamic
    Flag specifying that the rule is dynamic (can be changed programmatically through the ISpGrammarBuilder interface). Note that the CFG must be loaded with the SPLO_DYNAMIC flag to enable changes at run time.
  • SPRAF_Root
    Flag specifying whether this is the root rule in the grammar. This is only meaningful for XML-format grammars that conform to the Speech Recognition Grammar Specification (SRGS) Version 1.0.
  • SPRAF_AutoPause
    Flag specifying the grammar attributes as AutoPause. This flag is only valid at run time as part of a rule state and is not valid to pass as part of a rule definition.
  • SPRAF_UserDelimited
    Indicates that the audio will start when the user starts speaking and will end when the user stops speaking.

Remarks

With the exception of SPRAF_AutoPause and SPRAF_UserDelimited, you can set all the SPCFGRULEATTRIBUTES flags using the dwAttributes parameter of ISpGrammarBuilder::GetRule. The SPRAF_AutoPause and SPRAF_UserDelimited flags are only valid at run-time as part of a rule state and are not valid to pass as part of a rule definition.