Partager via


MenuActivity.UseDefaultGrammars Property

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Gets or sets whether the default grammars is used in the get and confirm phases.

Namespace: Microsoft.SpeechServer.Dialog
Assembly: Microsoft.SpeechServer (in microsoft.speechserver.dll)

Syntax

'Declaration
<GlobalizedCategoryAttribute("SpeechCategory")> _
<GlobalizedDescriptionAttribute("MenuActivity_UseDefaultGrammars")> _
<DefaultValueAttribute(True)> _
Public Property UseDefaultGrammars As Boolean
[GlobalizedCategoryAttribute("SpeechCategory")] 
[GlobalizedDescriptionAttribute("MenuActivity_UseDefaultGrammars")] 
[DefaultValueAttribute(true)] 
public bool UseDefaultGrammars { get; set; }

Property Value

True if default grammars are used in the get and confirm phases; otherwise False. The default value is False.

Remarks

The default get-phase grammars recognize "that one" and the menu options. The default confirmation-phase grammars recognize "yes" and "no" and perform dynamic correction based on the contents of the get-phase grammars.

For an example of dynamic correction, suppose that the semantic value obtained in the get phase is "red," which generates a confirmation prompt of "Did you say red?" A user response of "No, blue" causes a denial of the semantic value "red" and resets the semantic value to "blue." If the confidence in this utterance is less than or equal to the value in ConfirmationThreshold, the confirmation phase restarts. If the confidence in this utterance is greater than or equal to the value in ConfirmationThreshold, the MenuActivity exits with RecognitionResult reflecting the new semantic value.

Example

The following example creates a MenuActivity instance named chooseSize and sets a number of properties on the instance. In the highlighted line of code, UseDefaultGrammars is set to True.

this.chooseSize = new Microsoft.SpeechServer.Dialog.MenuActivity();
this.chooseSize.CanBargeIn = true;
this.chooseSize.ConfirmationThreshold = 1F;
this.chooseSize.DataField = "";
this.chooseSize.DataMember = "";
this.chooseSize.DataSource = null;
this.chooseSize.CompleteTimeout = System.TimeSpan.Parse("00:00:01.5000000");
this.chooseSize.InitialSilenceTimeout = System.TimeSpan.Parse("00:00:01.5000000");
this.chooseSize.Name = "chooseSize";
this.chooseSize.SynonymsField = "";
this.chooseSize.UseDefaultGrammars = true;
this.chooseSize.ConfirmationTurnStarting += new System.EventHandler<Microsoft.SpeechServer.Dialog.TurnStartingEventArgs>(this.chooseSize_ConfirmationTurnStarting);
this.chooseSize.TurnStarting += new System.EventHandler<Microsoft.SpeechServer.Dialog.TurnStartingEventArgs>(this.chooseSize_TurnStarting);
this.Activities.Add(this.chooseSize);

Thread Safety

All public static (Shared in Visual Basic) members of this type are thread-safe. Instance members are not guaranteed to be thread-safe.

Platforms

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003, Windows Vista Ultimate Edition, Windows Vista Business Edition, Windows Vista Enterprise Edition

Target Platforms

Windows Server 2003

See Also

Reference

MenuActivity Class
MenuActivity Members
Microsoft.SpeechServer.Dialog Namespace
MenuActivity.ConfirmationThreshold Property
MenuActivity.RecognitionResult Property
MenuActivity.UseDefaultGrammarsProperty Field