class GrammarList

class GrammarList
  : public Grammar

Represents a list of grammars for dynamic grammar scenarios. Added in version 1.7.0.

GrammarLists are only usable in specific scenarios and are not generally available.



Syntax: public inline explicit GrammarList ( SPXGRAMMARHANDLE hgrammar );

Internal constructor. Creates a new instance using the provided handle.


  • hgrammar GrammarList handle.


Syntax: public template< > inline void Add ( std::shared_ptr< T > grammar );

Adds a single grammar to the current grammar list


  • grammar The grammar to add

Currently Class Language Models are the only support grammars to add.


Syntax: public inline void SetRecognitionFactor ( double factor , RecognitionFactorScope scope );

Sets the Recognition Factor applied to all grammars in a recognizer's GrammarList


  • factor The RecognitionFactor to apply

  • scope The scope for the Recognition Factor being set

The Recognition Factor is a numerical value greater than 0 modifies the default weight applied to supplied grammars. Setting the Recognition Factor to 0 will disable the supplied grammars. The default Recognition Factor is 1.


Syntax: public template< > inline static std::shared_ptr< GrammarList > FromRecognizer ( std::shared_ptr< T > recognizer );

Creates a grammar lsit for the specified recognizer.


  • recognizer The recognizer from which to obtain the grammar list.


The grammar list associated with the recognizer.

Creating a grammar list from a recognizer is only usable in specific scenarios and is not generally available.