GrammarBuilder.DebugShowPhrases Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mendapatkan string yang menunjukkan konten dan struktur tata bahasa yang dimuat oleh GrammarBuilder.
public:
property System::String ^ DebugShowPhrases { System::String ^ get(); };
public string DebugShowPhrases { get; }
member this.DebugShowPhrases : string
Public ReadOnly Property DebugShowPhrases As String
Nilai Properti
Konten dan struktur saat ini dari GrammarBuilder.
Contoh
Contoh berikut membuat tata bahasa pengenalan ucapan untuk memesan pizza dengan hingga empat topping. Ini menulis status GrammarBuilder ke konsol sebelum membuat tata bahasa. Metode ini menghasilkan output berikut:
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;
}
Berlaku untuk
Lihat juga
Saran dan Komentar
https://aka.ms/ContentUserFeedback.
Segera hadir: Sepanjang tahun 2024 kami akan menghentikan penggunaan GitHub Issues sebagai mekanisme umpan balik untuk konten dan menggantinya dengan sistem umpan balik baru. Untuk mengetahui informasi selengkapnya, lihat:Kirim dan lihat umpan balik untuk