GrammarBuilder.DebugShowPhrases 속성

정의

GrammarBuilder가 포함하는 문법의 콘텐츠와 구조를 보여주는 문자열을 가져옵니다.

public:
 property System::String ^ DebugShowPhrases { System::String ^ get(); };
public string DebugShowPhrases { get; }
member this.DebugShowPhrases : string
Public ReadOnly Property DebugShowPhrases As String

속성 값

String

GrammarBuilder의 현재 콘텐츠 및 구조체입니다.

예제

다음 예제에서는 최대 4 개의 토 핑을 사용 하 여 피자를 주문에 대 한 음성 인식 문법을 만듭니다. 상태를 기록 합니다 GrammarBuilder 문법을 만들기 전에 콘솔. 이 메서드는 다음 출력을 생성합니다.

  • GrammarBuilder status: I would like a [cheese,mushroom,tomato,onion,anchovy,chic ken,pepperoni] and [cheese,mushroom,tomato,onion,anchovy,chicken,pepperoni] pizza
private static Grammar CreatePizzaGrammar()  
{  

  // Create a Choices object with alternatives for toppings.  
  Choices toppings = new Choices(new string[] {  
    "cheese", "mushroom", "tomato", "onion",  
    "anchovy", "chicken", "pepperoni"});  

  // Create a GrammarBuilder and append the Choices object.  
  GrammarBuilder andToppings = new GrammarBuilder("and", 0, 1);  
  andToppings.Append(toppings);  

  // Construct the phrase.  
  GrammarBuilder gb = new GrammarBuilder("I would like a", 0, 1);  
  gb.Append(toppings);  
  gb.Append(new GrammarBuilder(andToppings, 0, 3));  
  gb.Append("pizza");  

  // Write the contents and structure of the GrammarBuilder to the console.  
  Console.WriteLine("Grammar content and structure: {0}", gb.DebugShowPhrases);  

  // Create the Grammar from the GrammarBuilder.  
  Grammar grammar = new Grammar(gb);  
  grammar.Name = "Pizza Order";  

  return grammar;  
}  

적용 대상

추가 정보