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.

Members

GrammarList

Syntax: public inline explicit GrammarList ( SPXGRAMMARHANDLE hgrammar );

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

Parameters

  • hgrammar GrammarList handle.

Add

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

Adds a single grammar to the current grammar list.

Parameters

  • grammar The grammar to add

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

SetRecognitionFactor

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

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

Parameters

  • 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.

FromRecognizer

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

Creates a grammar lsit for the specified recognizer.

Parameters

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

Returns

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.