diff --git a/xml/System.Speech.Recognition.SrgsGrammar/SrgsDocument.xml b/xml/System.Speech.Recognition.SrgsGrammar/SrgsDocument.xml index 1feea779732..22d8dbd8398 100644 --- a/xml/System.Speech.Recognition.SrgsGrammar/SrgsDocument.xml +++ b/xml/System.Speech.Recognition.SrgsGrammar/SrgsDocument.xml @@ -253,7 +253,6 @@ Console.WriteLine("Root Rule " + bookFlight.Root.Id); Grammar g = new Grammar(bookFlight); g.Name = ("City Chooser"); recognizer.LoadGrammarAsync(g); - ``` ]]> diff --git a/xml/System.Speech.Recognition.SrgsGrammar/SrgsOneOf.xml b/xml/System.Speech.Recognition.SrgsGrammar/SrgsOneOf.xml index 4d3a38dfa35..407de79d273 100644 --- a/xml/System.Speech.Recognition.SrgsGrammar/SrgsOneOf.xml +++ b/xml/System.Speech.Recognition.SrgsGrammar/SrgsOneOf.xml @@ -89,10 +89,9 @@ ## Examples The following example uses the element to build lists of elements containing country/region names, any one of which may be used to recognize the containing phrase. The example then adds one of the resulting objects to their respective rules for European and South American countries/regions. Further on, the example uses the object to group rule references to `ruleEurope` and `ruleSAmerica` into a list of two alternatives, either one of which may be used to recognize spoken input. -``` +```csharp public void WorldSoccerWinners () { - // Create an SrgsDocument, create a new rule // and set its scope to public. SrgsDocument document = new SrgsDocument(); @@ -121,7 +120,6 @@ public void WorldSoccerWinners () document.Rules.Add(new SrgsRule[] {winnerRule, ruleEurope, ruleSAmerica}); document.Root = winnerRule; } - ``` ]]> @@ -236,7 +234,7 @@ public void WorldSoccerWinners () ## Examples The following example creates a grammar that recognizes the phrase "A nation that has won the World Cup is" followed by the name of a country/region that has won the World Cup. The example uses the element to build lists of acceptable country/region names from an array of objects. The example then adds one of the resulting objects to their respective rules for European and South American countries/regions. -``` +```csharp public void WorldSoccerWinners () { // Create a grammar from an SRGSDocument, create a new rule @@ -305,10 +303,9 @@ public void WorldSoccerWinners () ## Examples The following example creates a grammar that recognizes the phrase "A nation that has won the World Cup is" followed by the name of a country/region that has won the World Cup. The example uses the object to build lists of acceptable country/region names from an array of objects. Using the method, the example appends an that contains the string "Italy" to the object `oneOfEurope`. -``` +```csharp public void WorldSoccerWinners () { - // Create an SrgsDocument, create a new rule // and set its scope to public. SrgsDocument document = new SrgsDocument(); diff --git a/xml/System.Speech.Recognition.SrgsGrammar/SrgsRuleRef.xml b/xml/System.Speech.Recognition.SrgsGrammar/SrgsRuleRef.xml index 2391fd4a7fa..123c701fe1f 100644 --- a/xml/System.Speech.Recognition.SrgsGrammar/SrgsRuleRef.xml +++ b/xml/System.Speech.Recognition.SrgsGrammar/SrgsRuleRef.xml @@ -105,7 +105,7 @@ ## Examples The following example creates a grammar that recognizes the phrase "A nation that has won the World Cup is" followed by the name of a country that has won the World Cup. After creating the object `winnerRule` and giving it the string identifier `WorldCupWinner`, the example appends the string "A nation that has won the World Cup is" to the rule. Using objects, the example then builds a list of European countries/regions and a list of South American countries/regions, and adds each list to its respective rule, `ruleEurope` or `ruleSAmerica`. The example then creates rule references for `ruleEurope` and `ruleSAmerica` and adds them to the `WorldCupWinner` rule. -``` +```csharp public void WorldSoccerWinners () { @@ -141,7 +141,7 @@ public void WorldSoccerWinners () The created grammar has the following form. -``` +```xml A nation that has won the world cup is @@ -218,7 +218,7 @@ public void WorldSoccerWinners () The second method, `CreateGrammarForRoute`, creates an element named `grammar` with a rule reference specified by the `Uri` passed to it by `GrammarUrlForRoute`. Note that the variable named _route is a member of an enclosing class. -``` +```csharp private Uri GrammarUrlForRoute(string route) { return new Uri("http://localhost/MyBus/MyBusLocations.grxml#LocationsForRoute" + route); @@ -292,7 +292,7 @@ private SrgsDocument CreateGrammarForRoute() ## Examples The following example creates a grammar for choosing the cities for a flight. The example constructs two instances, each of which specifies a semantic key. Both rule references target the same object, named `cities`, but tag the recognition result from the rule reference with a different semantic key. The semantic key identifies a recognized city as the departure city or the arrival city for the flight. The handler for the event uses the keys to retrieve the semantics values created using from the recognition result. -``` +```csharp using System; using System.Speech.Recognition; using System.Speech.Recognition.SrgsGrammar; diff --git a/xml/System.Speech.Recognition.SrgsGrammar/SrgsSemanticInterpretationTag.xml b/xml/System.Speech.Recognition.SrgsGrammar/SrgsSemanticInterpretationTag.xml index 0623d56e580..fa1d92efde8 100644 --- a/xml/System.Speech.Recognition.SrgsGrammar/SrgsSemanticInterpretationTag.xml +++ b/xml/System.Speech.Recognition.SrgsGrammar/SrgsSemanticInterpretationTag.xml @@ -38,16 +38,12 @@ ## Remarks The default semantic format for System.Speech conforms to the W3C [Semantic Interpretation for Speech Recognition (SISR) Version 1.0](https://www.w3.org/TR/semantic-interpretation/), where the format for `tag` elements that contain script is `semantics/1.0`. You must specify the script for objects using this format. In the syntax of `semantics/1.0`: -- The Rule Variable of the containing rule element is identified by "out". - -- The name of the object that has access to the Rule Variable of rule elements outside the containing rule element is identified by "rules". - -- The result from the latest referenced rule that matches the utterance can be represented by "rules.latest()". +- The Rule Variable of the containing rule element is identified by "out". +- The name of the object that has access to the Rule Variable of rule elements outside the containing rule element is identified by "rules". +- The result from the latest referenced rule that matches the utterance can be represented by "rules.latest()". You can also associate a semantic value with a phrase in a grammar without using script, using the object. - - ## Examples The following example creates a grammar for choosing the cities for a flight. The example uses to assign a semantic value to each city, which is the code for the city's airport. The example also uses to assign a separate semantic key for each of the two references made by the object named `cityRef` to the object named `cities`. The semantic keys identify a recognized city as the departure city or the arrival city for the flight. The handler for the event uses the keys to retrieve the semantics from the recognition result. @@ -55,7 +51,7 @@ The expression "rules.flightCities" refers to the Rule Variable on the rule whose is `flightCities`, and which is the target of a rule reference. In the example, the expression "out.LeavingFrom=rules.flightCities;" assigns the value from the rule whose is `flightCities` to the property named `LeavingFrom` of the Rule Variable on the rule named `bookFlight`. See [Semantic Results Content](https://msdn.microsoft.com/library/622291af-615c-4a15-9014-2933aa3f89fe), [Grammar Rule Name Referencing](https://msdn.microsoft.com/library/0777e975-8665-4cc3-957b-752743cb1bb9), and [Grammar Rule Reference Referencing](https://msdn.microsoft.com/library/dec3a809-9aa2-4139-893f-3a549ca1e03e) for more information. -``` +```csharp using System; using System.Speech.Recognition; using System.Speech.Recognition.SrgsGrammar; @@ -136,7 +132,6 @@ namespace SampleRecognition } } } - ``` The following is the XML form of the grammar generated by the code in the example above. diff --git a/xml/System.Speech.Recognition.SrgsGrammar/SrgsToken.xml b/xml/System.Speech.Recognition.SrgsGrammar/SrgsToken.xml index fe09f9c93f3..63c739babd6 100644 --- a/xml/System.Speech.Recognition.SrgsGrammar/SrgsToken.xml +++ b/xml/System.Speech.Recognition.SrgsGrammar/SrgsToken.xml @@ -161,7 +161,7 @@ ## Examples The grammar in the following example contains slang words and also has an uncommon word: "whatchamacallit". Adding a custom, inline pronunciation using the property of the class can improve the accuracy of recognition for the word "whatchamacallit" as well as for the entire phrase that contains it. The example uses phones from the Microsoft Universal Phone Set (UPS) to define the custom pronunciations. -``` +```csharp using System; using System.Speech.Recognition; using System.Speech.Recognition.SrgsGrammar; @@ -236,7 +236,6 @@ namespace SampleRecognition } } } - ``` ]]> diff --git a/xml/System.Speech.Recognition/Choices.xml b/xml/System.Speech.Recognition/Choices.xml index 92746c188ca..941957b4fd6 100644 --- a/xml/System.Speech.Recognition/Choices.xml +++ b/xml/System.Speech.Recognition/Choices.xml @@ -551,7 +551,6 @@ public Grammar CreatePhonePhrase() The following example creates a speech recognition grammar for changing the background color. ```csharp - private Grammar CreateColorChoice() { @@ -569,7 +568,6 @@ private Grammar CreateColorChoice() return grammar; } - ``` ]]> diff --git a/xml/System.Speech.Recognition/Grammar.xml b/xml/System.Speech.Recognition/Grammar.xml index 0be1cdd3250..d14c215269a 100644 --- a/xml/System.Speech.Recognition/Grammar.xml +++ b/xml/System.Speech.Recognition/Grammar.xml @@ -65,11 +65,9 @@ private static Grammar CreateGrammarFromFile() citiesGrammar.Name = "SRGS File Cities Grammar"; return citiesGrammar; } - ``` ```xml - @@ -469,11 +464,9 @@ private static Grammar CreateGrammarFromFile() citiesGrammar.Name = "SRGS File Cities Grammar"; return citiesGrammar; } - ``` ```xml - @@ -801,7 +791,6 @@ namespace SampleRecognition The following example loads a local SRGS file (cities.xml) from a file and specifies a rule to use as the root of the grammar. The content of the cities.xml file appears in the XML example that follows the C# example. ```csharp - // Load a cities grammar from a local file, use a specific // rule as the root of the grammar, and return the new grammar. private static Grammar CreateGrammarFromFile2() @@ -813,7 +802,6 @@ private static Grammar CreateGrammarFromFile2() ``` ```xml - that contains a relative rule reference to the cities.xml file, and specifies a URI to use to resolve the rule reference. The content of the cities.xml file appears in the XML example that follows the C# example. ```csharp - private static Grammar CreateSrgsDocumentGrammar3() { // Create the SrgsDocument. @@ -1163,11 +1147,9 @@ private static Grammar CreateSrgsDocumentGrammar3() return citiesGrammar; } - ``` ```xml - object to the [console](https://go.microsoft.com/fwlink/?LinkId=159613). ```csharp - private static void DumpGrammarStatus(Grammar item) { Console.WriteLine("Grammar name is {0}:", item.Name); @@ -1498,7 +1479,6 @@ private static void DumpGrammarStatus(Grammar item) The following example writes information about a object to the [console](https://go.microsoft.com/fwlink/?LinkId=159613). ```csharp - private static void DumpGrammarStatus(Grammar item) { Console.WriteLine("Grammar name is {0}:", item.Name); @@ -1600,7 +1580,6 @@ private static void DumpGrammarStatus(Grammar item) The following example creates two objects, one for digits and one for fractions. The Grammar objects are assigned names and relative weights and priorities, and loaded by an in-process speech recognizer. The `CreateDigitsGrammar`, `CreateFractionsGrammar`, and `recognizer_SpeechRecognized` methods are not shown here. ```csharp - // Create a Grammar for recognizing numeric digits. Grammar digitsGrammar = CreateDigitsGrammar(); digitsGrammar.Name = "Digits Grammar"; @@ -1673,7 +1652,6 @@ recognizer.RecognizeAsync(RecognizeMode.Multiple); The following example creates two objects, one for digits and one for fractions. The objects are assigned names and relative weights and priorities, and loaded by an in-process speech recognizer. The `CreateDigitsGrammar`, `CreateFractionsGrammar`, and `recognizer_SpeechRecognized` methods are not shown here. ```csharp - // Create a Grammar for recognizing numeric digits. Grammar digitsGrammar = CreateDigitsGrammar(); digitsGrammar.Name = "Digits Grammar"; @@ -1782,7 +1760,6 @@ recognizer.RecognizeAsync(RecognizeMode.Multiple); The following example writes information about a object to the [console](https://go.microsoft.com/fwlink/?LinkId=159613). ```csharp - private static void DumpGrammarStatus(Grammar item) { Console.WriteLine("Grammar name is {0}:", item.Name); @@ -1963,7 +1940,6 @@ public partial class Form1 : Form The following example creates two objects, one for digits and one for fractions. The objects are assigned names and relative weights and priorities, and loaded by an in-process speech recognizer. The `CreateDigitsGrammar`, `CreateFractionsGrammar`, and `recognizer_SpeechRecognized` methods are not shown here. ```csharp - // Create a Grammar for recognizing numeric digits. Grammar digitsGrammar = CreateDigitsGrammar(); digitsGrammar.Name = "Digits Grammar"; diff --git a/xml/System.Speech.Recognition/GrammarBuilder.xml b/xml/System.Speech.Recognition/GrammarBuilder.xml index 6cdd7ab33e5..3dd828b8e1a 100644 --- a/xml/System.Speech.Recognition/GrammarBuilder.xml +++ b/xml/System.Speech.Recognition/GrammarBuilder.xml @@ -62,7 +62,6 @@ The example finally creates a object from a constructed from a object. ```csharp - private Grammar CreateColorGrammar() { @@ -83,7 +82,6 @@ private Grammar CreateColorGrammar() grammar.Name = "backgroundColor"; return grammar; } - ``` ]]> @@ -157,7 +155,6 @@ private Grammar CreateColorGrammar() The example finally creates a object from a constructed from a object. ```csharp - private Grammar CreateColorGrammar() { @@ -180,7 +177,6 @@ private Grammar CreateColorGrammar() grammar.Name = "backgroundColor"; return grammar; } - ``` ]]> @@ -227,7 +223,6 @@ private Grammar CreateColorGrammar() The example finally creates a object from a constructed from a object. ```csharp - private Grammar CreateColorGrammar() { @@ -248,7 +243,6 @@ private Grammar CreateColorGrammar() grammar.Name = "backgroundColor"; return grammar; } - ``` ]]> @@ -298,7 +292,6 @@ private Grammar CreateColorGrammar() The example uses , , , , and objects to build the constraints that are all contained in the last object, `bothPhrases`. Finally, the example constructs a object from the completed . ```csharp - private Grammar CreateColorGrammar() { @@ -390,7 +383,6 @@ private Grammar CreateColorGrammar() The example uses , , , , and objects to build the constraints that are all contained in the last object, `bothPhrases`. Finally, the example constructs a object from the completed . ```csharp - private Grammar CreateColorGrammar() { @@ -479,7 +471,6 @@ private Grammar CreateColorGrammar() The example finally creates a object from a object cast to a object. ```csharp - private Grammar CreateColorGrammar() { @@ -500,7 +491,6 @@ private Grammar CreateColorGrammar() grammar.Name = "backgroundColor"; return grammar; } - ``` ]]> @@ -547,7 +537,6 @@ private Grammar CreateColorGrammar() The following example creates a speech recognition grammar for each value and a grammar for choosing between the matching mode grammars. If the value of `phrase` is "one two three four five six seven", then the Subsequence grammar recognizes the input "two three four", but not the input "one three five". However, the Ordered Subset grammar recognizes both of these inputs. ```csharp - private static IEnumerable CreateMatchingModeGrammars(string phrase) { @@ -645,7 +634,6 @@ private static string BreakAtCaps(string item) The following example creates a speech recognition grammar for ordering a pizza. It starts with an optional, opening phrase, followed by one to four toppings, and closes with the word "pizza". ```csharp - private static Grammar CreatePizzaGrammar() { @@ -716,7 +704,6 @@ private static Grammar CreatePizzaGrammar() The following example creates a speech recognition grammar for ordering a pizza. It starts with an optional, opening phrase, followed by one to four toppings, and closes with the word "pizza". ```csharp - private static Grammar CreatePizzaGrammar() { @@ -880,7 +867,6 @@ private static Grammar CreatePizzaGrammar() The following example creates a speech recognition grammar that can recognize the two phrases, "Make background *color*" and "Set background to *color*", where *color* is selected from a set of colors. Various types are used to build the final grammar, such as [String](https://go.microsoft.com/fwlink/?LinkId=159733), , and objects. The explicit cast operators in the calls to the methods are optional. ```csharp - private Grammar CreateColorGrammar() { @@ -964,7 +950,6 @@ private Grammar CreateColorGrammar() The following example creates a speech recognition grammar that can recognize the two phrases, "Make background *color*" and "Set background to *color*", where *color* is selected from a set of colors. Various types are used to build the final grammar, such as [String](https://go.microsoft.com/fwlink/?LinkId=159733), , and objects. The explicit cast operators in the calls to the methods are optional. ```csharp - private Grammar CreateColorGrammar() { @@ -1045,7 +1030,6 @@ private Grammar CreateColorGrammar() The following example creates a speech recognition grammar that can recognize the two phrases, "Make background *color*" and "Set background to *color*", where *color* is selected from a set of colors. Various types are used to build the final grammar, such as [String](https://go.microsoft.com/fwlink/?LinkId=159733), , and objects. The explicit cast operators in the calls to the methods are optional. ```csharp - private Grammar CreateColorGrammar() { @@ -1126,7 +1110,6 @@ private Grammar CreateColorGrammar() The following example creates a speech recognition grammar that can recognize the two phrases, "Make background *color*" and "Set background to *color*", where *color* is selected from a set of colors. Various types are used to build the final grammar, such as [String](https://go.microsoft.com/fwlink/?LinkId=159733), , and objects. The explicit cast operators in the calls to the methods are optional. ```csharp - private Grammar CreateColorGrammar() { @@ -1219,7 +1202,6 @@ private Grammar CreateColorGrammar() The following example creates a speech recognition grammar for phrases such as "Call James at work" and "Call Anne on her cell phone", where the word "phone" is optional. The example highlights the use of the method. ```csharp - public static Grammar CreatePhonePhrase() { // Create alternatives for person names, locations, devices, and pronouns. @@ -1297,7 +1279,6 @@ public static Grammar CreatePhonePhrase() The following example creates a speech recognition grammar for phrases such as "Call James at work" and "Call Anne on her cell phone", where the word "phone" is optional. and objects are used to construct the grammar. The example highlights the use of the method. ```csharp - public static Grammar CreatePhonePhrase() { // Create alternatives for person names, locations, devices, and pronouns. @@ -1450,7 +1431,6 @@ namespace SampleRecognition } } } - ``` ]]> @@ -1498,7 +1478,6 @@ namespace SampleRecognition The following example is part of a console application for choosing origin and destination cities for a flight. The application recognizes phrases such as "I want to fly from Miami to Chicago." The handler for the event uses the to extract the airport code specified in the for the origin and destination cities. ```csharp - using System; using System.Speech.Recognition; @@ -1582,7 +1561,6 @@ namespace SampleRecognition } } } - ``` ]]> @@ -1667,7 +1645,6 @@ namespace SampleRecognition The following example creates a speech recognition grammar for each value. For example, the generated grammar `OrderedSubset` recognizes the phrases, "three four five" and "one three five", and the grammar `Subsequence` recognizes the phrase "three four five", but not the phrase, "one three five". ```csharp - private Grammar[] CreateSubsetMatchTest() { List grammars = new List(4); @@ -1737,7 +1714,6 @@ private Grammar[] CreateSubsetMatchTest() The following example creates a speech recognition grammar for phrases such as "Call James at work" and "Call Anne on her cell phone", where the word "phone" is optional. and objects are used to construct the grammar. The example highlights the use of the method. ```csharp - public static Grammar CreatePhonePhrase() { // Create alternatives for person names, locations, devices, and pronouns. @@ -1819,7 +1795,6 @@ public static Grammar CreatePhonePhrase() The following example creates a speech recognition grammar for phrases such as "Call James at work" and "Call Anne on her cell phone", where the word "phone" is optional. and objects are used to construct the grammar. The example highlights the use of the method. ```csharp - public static Grammar CreatePhonePhrase() { // Create alternatives for person names, locations, devices, and pronouns. @@ -1913,7 +1888,6 @@ public static Grammar CreatePhonePhrase() The following example creates a speech recognition grammar that incorporates dictation. ```csharp - GrammarBuilder builder = new GrammarBuilder(); builder.Append("begin"); builder.AppendDictation(); @@ -1964,7 +1938,6 @@ grammarWithDictation.Name = "Grammar with Dictation"; The following example creates a speech recognition grammar that incorporates the spelling dictation grammar rules. ```csharp - GrammarBuilder builder = new GrammarBuilder(); builder.Append("begin"); builder.AppendDictation("spelling"); @@ -2040,7 +2013,6 @@ grammarWithDictation.Name = "Grammar with Dictation"; The following C# example creates a speech recognition grammar that uses the rule named `Cities` in a local SRGS file, cities.grxml. The content of the cities.grxml file appears below the C# code example. ```csharp - private static Grammar CreateCitiesGrammar1() { GrammarBuilder builder = new GrammarBuilder(); @@ -2053,7 +2025,6 @@ private static Grammar CreateCitiesGrammar1() ``` ```xml - object's culture to English (United States). ```csharp - private static Grammar CreatePizzaGrammar() { @@ -2411,7 +2379,6 @@ private static Grammar CreatePizzaGrammar() - `GrammarBuilder status: I would like a [cheese,mushroom,tomato,onion,anchovy,chic ken,pepperoni] and [cheese,mushroom,tomato,onion,anchovy,chicken,pepperoni] pizza` ```csharp - private static Grammar CreatePizzaGrammar() { @@ -2582,7 +2549,6 @@ private static Grammar CreatePizzaGrammar() The following example creates a speech recognition grammar that can recognize the two phrases, "Make background *color*" and "Set background to *color*", where *color* is selected from a set of colors. Various types are used to build the final grammar, such as [String](https://go.microsoft.com/fwlink/?LinkId=159733), , and objects. ```csharp - private Grammar CreateColorGrammar() { @@ -2777,7 +2743,6 @@ private Grammar CreateColorGrammar() The following example creates a speech recognition grammar that can recognize the two phrases, "Make background *color*" and "Set background to *color*", where *color* is selected from a set of colors. Various types are used to build the final grammar, such as [String](https://go.microsoft.com/fwlink/?LinkId=159733), , and objects. ```csharp - private Grammar CreateColorGrammar() { @@ -2940,7 +2905,6 @@ SemanticResultKey yesnoKey = Grammar yesnoGrammar = new Grammar(yesnoKey); yesnoGrammar.Name = "yesno"; - ``` ]]> @@ -2997,7 +2961,6 @@ SemanticResultKey yesnoKey = Grammar yesnoGrammar = new Grammar(yesnoKey); yesnoGrammar.Name = "yesno"; - ``` ]]> diff --git a/xml/System.Speech.Recognition/RecognizedWordUnit.xml b/xml/System.Speech.Recognition/RecognizedWordUnit.xml index 93a34e89b96..cb5a9c45d7a 100644 --- a/xml/System.Speech.Recognition/RecognizedWordUnit.xml +++ b/xml/System.Speech.Recognition/RecognizedWordUnit.xml @@ -54,7 +54,6 @@ The following example shows a utility routine (`stringFromWordArray`) that generates strings. The strings contain lexical output (using ), normalized text (using ), or phonetic characters from the International Phonetic Alphabet (using ). Strings are formatted using objects obtained from the property from a of objects. The objects are obtained from the property on the object. ```csharp - internal enum WordType { Text, @@ -312,7 +311,6 @@ private void _emulateAndVerify_Click(object sender, EventArgs e) The following example shows a utility routine (`stringFromWordArray`) that generates a string that is formatted in one of three ways: lexically (using ), normalized (using ), or phonetically (using ). The text output is obtained from the property on a of objects, which is obtained from the property on a object. ```csharp - internal enum WordType { Text, @@ -417,7 +415,6 @@ internal static string stringFromWordArray( The following example shows a utility routine that generates text in one of three formats: lexical (using ), normalized (using ), and phonetic (using ). The text output is obtained from a of objects, which is obtained from the property on the object. ```csharp - internal enum WordType { Text, @@ -524,7 +521,6 @@ internal static string stringFromWordArray( The following example shows a utility routine that generates a string with one of three possible formats: lexical (using ), normalized (using ), and phonetic (using ). The text output is obtained from a of objects, which is obtained from the property on the object. ```csharp - internal enum WordType { Text, @@ -629,7 +625,6 @@ internal static string stringFromWordArray( The following example shows a utility routine that generates a string in one of three formats: lexical (using ), normalized (using ), and phonetic (using ). The text output is obtained from a of objects, which is obtained from the property on the object. ```csharp - internal enum WordType { Text, diff --git a/xml/System.Speech.Recognition/RecognizerInfo.xml b/xml/System.Speech.Recognition/RecognizerInfo.xml index c1b3c3e55d2..760b246450f 100644 --- a/xml/System.Speech.Recognition/RecognizerInfo.xml +++ b/xml/System.Speech.Recognition/RecognizerInfo.xml @@ -50,7 +50,6 @@ If the and identifier string are valid, the example creates a new instance of using the instance as an argument. ```csharp - private SpeechRecognitionEngine SelectRecognizer(CultureInfo requiredCulture, string requiredId) { // Select based on a specific recognizer configuration @@ -352,7 +351,7 @@ private void recognizerInfoButton_Click(object sender, EventArgs e) ## Examples The following example implements a button click that displays all the information in a instance. The example uses the property to obtain the identifier string of a recognition engine configuration, and then displays it in a . -``` +```csharp private void recognizerInfoButton_Click(object sender, EventArgs e) { RecognizerInfo info = _recognizer.RecognizerInfo; @@ -421,7 +420,7 @@ private void recognizerInfoButton_Click(object sender, EventArgs e) ## Examples The following example implements a button click that displays all the information in a instance. The example uses the property to obtain the friendly name of a recognition engine configuration, and then displays it in a . -``` +```csharp private void recognizerInfoButton_Click(object sender, EventArgs e) { RecognizerInfo info = _recognizer.RecognizerInfo; @@ -490,7 +489,7 @@ private void recognizerInfoButton_Click(object sender, EventArgs e) ## Examples The following example implements a button click that displays all the information in a instance. The example uses the property to obtain the encoding formats supported by a recognition engine configuration, and then displays it in a . -``` +```csharp private void recognizerInfoButton_Click(object sender, EventArgs e) { RecognizerInfo info = _recognizer.RecognizerInfo; diff --git a/xml/System.Speech.Recognition/SemanticResultKey.xml b/xml/System.Speech.Recognition/SemanticResultKey.xml index 36a213a8ac4..e3c0d8121db 100644 --- a/xml/System.Speech.Recognition/SemanticResultKey.xml +++ b/xml/System.Speech.Recognition/SemanticResultKey.xml @@ -343,7 +343,6 @@ private void keyTest() A is then obtained by calling on a instance, which will be used to key the semantic choices in `colorChoice`. ```csharp - private Grammar CreateGrammarBuilderRGBSemantics() { @@ -374,7 +373,6 @@ private Grammar CreateGrammarBuilderRGBSemantics() return grammar; } - ``` ]]> diff --git a/xml/System.Speech.Recognition/SemanticResultValue.xml b/xml/System.Speech.Recognition/SemanticResultValue.xml index 312eccfde93..820ba607829 100644 --- a/xml/System.Speech.Recognition/SemanticResultValue.xml +++ b/xml/System.Speech.Recognition/SemanticResultValue.xml @@ -87,8 +87,7 @@ SemanticResultKey fgOrbgChoiceKey = new SemanticResultKey("BgOrFgText", fgOrbgCh ## Examples The following example returns a that recognizes the command "Set/Change/Alter Foreground/Background … [color list]". and instances (in conjunction with and objects) are used to define semantics that can be parsed on recognition. The parsed semantics will determine which color was requested and whether the foreground or background is to be modified. -``` - +```csharp private Grammar FgBgColorGrammar() { Grammar grammar = null; @@ -204,7 +203,6 @@ backgroundGB.Append(new SemanticResultValue(true)); The following example returns a that recognizes the command "Set/Change/Alter Foreground/Background … [color list]". and instances (in conjunction with and objects) are used to define semantics that can be parsed on recognition. The parsed semantics will determine which color was requested and whether the foreground or background is to be modified. ```csharp - private Grammar FgBgColorGrammar() { Grammar grammar = null; @@ -301,7 +299,6 @@ myGb.Append(new SemanticResultValue(myChoice, true); The following example returns a that recognizes the command "Set/Change/Alter Foreground/Background … [color list]". and instances (in conjunction with and objects) are used to define semantics that can be parsed on recognition. The parsed semantics will determine which color was requested and whether the foreground or background is to be modified. ```csharp - private Grammar FgBgColorGrammar() { Grammar grammar = null; @@ -394,7 +391,7 @@ myGb.Append(new SemanticResultValue("my mortgage", true); ## Examples The following example returns a that recognizes the command "Set/Change/Alter Foreground/Background … [color list]". and instances (in conjunction with and objects) are used to define semantics that can be parsed on recognition. The parsed semantics will determine which color was requested and whether the foreground or background is to be modified. -``` +```csharp private Grammar FgBgColorGrammar() { Grammar grammar = null; @@ -442,7 +439,6 @@ private Grammar FgBgColorGrammar() grammar.Name = "Tree [Set,change,alter] [foreground,background] * color"; return grammar; } - ``` ]]> @@ -486,7 +482,6 @@ private Grammar FgBgColorGrammar() A is then obtained by calling on a instance, which will be used to key the semantic choices in the `colorChoice` instance. ```csharp - private Grammar CreateGrammarBuilderRGBSemantics() { @@ -520,7 +515,6 @@ private Grammar CreateGrammarBuilderRGBSemantics() return grammar; } - ``` ]]> diff --git a/xml/System.Speech.Recognition/SemanticValue.xml b/xml/System.Speech.Recognition/SemanticValue.xml index 63f96a96900..7d292d4b7e4 100644 --- a/xml/System.Speech.Recognition/SemanticValue.xml +++ b/xml/System.Speech.Recognition/SemanticValue.xml @@ -112,7 +112,6 @@ In other cases, the handler uses keys to obtain the RGB components of a color name, to determine whether the command will change the foreground or background, or to indicate that no valid key was found. ```csharp - newGrammar.SpeechRecognized += delegate(object sender, SpeechRecognizedEventArgs eventArgs) { @@ -455,7 +454,6 @@ internal static void CreateSemanticsTreeNodes( After handling phrases that are recognized but have no semantic structure, the handler checks for the presence of appropriate keys using (`applyChgToBackground`, `colorRGBValueList`, or `colorStringList)`, and then processes the semantically organized data. ```csharp - newGrammar.SpeechRecognized += delegate(object sender, SpeechRecognizedEventArgs eventArgs) { @@ -597,7 +595,6 @@ newGrammar.SpeechRecognized += In other cases, the handler uses keys to obtain the RGB components of a color name, to determine whether the command will change the foreground or background, or to indicate that no valid key was found. ```csharp - newGrammar.SpeechRecognized += delegate(object sender, SpeechRecognizedEventArgs eventArgs) { @@ -803,7 +800,6 @@ newGrammar.SpeechRecognized += The use of is highlighted below. ```csharp - newGrammar.SpeechRecognized += delegate(object sender, SpeechRecognizedEventArgs eventArgs) { diff --git a/xml/System.Speech.Recognition/SubsetMatchingMode.xml b/xml/System.Speech.Recognition/SubsetMatchingMode.xml index dfbd036abbe..0a85cd8a4ce 100644 --- a/xml/System.Speech.Recognition/SubsetMatchingMode.xml +++ b/xml/System.Speech.Recognition/SubsetMatchingMode.xml @@ -112,7 +112,7 @@ Following is a test routine that generates four objects, using the same phrase, for each of the `SubsetMatchingModes`. These objects can then be tested. -``` +```csharp private void CreateSubsetMatchTest() { foreach ( System.Speech.Recognition.SubsetMatchingMode mode diff --git a/xml/System.Speech.Synthesis.TtsEngine/SpeechEventInfo.xml b/xml/System.Speech.Synthesis.TtsEngine/SpeechEventInfo.xml index be9db58db69..17d2b848ddf 100644 --- a/xml/System.Speech.Synthesis.TtsEngine/SpeechEventInfo.xml +++ b/xml/System.Speech.Synthesis.TtsEngine/SpeechEventInfo.xml @@ -37,24 +37,22 @@ ## Remarks A custom speech synthesis engine requests the generation of events under the Speech Platform by providing an appropriate instance to member of the engine site object passed to implementations of , , and . - - ## Examples The example below is part of a custom speech synthesis implementation inheriting from , and using the use of , , , and The implementation of -1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. +1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. -2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation +2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation - - Translates Americanism to Britishisms in the text to be spoken. + - Translates Americanism to Britishisms in the text to be spoken. - - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. + - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. -3. A speech rendering engine is then called with the modified array. +3. A speech rendering engine is then called with the modified array. -``` +```csharp private const int WordBoundaryFlag = 1 << (int)TtsEventId.WordBoundary; private readonly char[] spaces = new char[] { ' ', '\t', '\r', '\n' }; internal struct UsVsUk @@ -161,17 +159,17 @@ override public void Speak (TextFragment [] frags, IntPtr wfx, ITtsEngineSite si The implementation of -1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. +1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. -2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation +2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation - - Translates Americanism to Britishisms in the text to be spoken. + - Translates Americanism to Britishisms in the text to be spoken. - - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. + - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. -3. A speech rendering engine is then called with the modified array. +3. A speech rendering engine is then called with the modified array. -``` +```csharp private const int WordBoundaryFlag = 1 << (int)TtsEventId.WordBoundary; private readonly char[] spaces = new char[] { ' ', '\t', '\r', '\n' }; internal struct UsVsUk @@ -327,19 +325,19 @@ override public void Speak (TextFragment [] frags, IntPtr wfx, ITtsEngineSite si The implementation of -1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. +1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. -2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation +2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation - - Translates Americanism to Britishisms in the text to be spoken. + - Translates Americanism to Britishisms in the text to be spoken. - - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. + - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. The parameters on , including are used to log the event generated through the `LogSpeechEvent` method. -3. A speech rendering engine is then called with the modified array. +3. A speech rendering engine is then called with the modified array. -``` +```csharp private const int WordBoundaryFlag = 1 << (int)TtsEventId.WordBoundary; private readonly char[] spaces = new char[] { ' ', '\t', '\r', '\n' }; internal struct UsVsUk @@ -526,19 +524,19 @@ override public void Speak (TextFragment [] frags, IntPtr wfx, ITtsEngineSite si The implementation of -1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. +1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. -2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation +2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation - - Translates Americanism to Britishisms in the text to be spoken. + - Translates Americanism to Britishisms in the text to be spoken. - - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. + - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. The parameters on , including are used to log the event generated through the `LogSpeechEvent` method. -3. A speech rendering engine is then called with the modified array. +3. A speech rendering engine is then called with the modified array. -``` +```csharp private const int WordBoundaryFlag = 1 << (int)TtsEventId.WordBoundary; private readonly char[] spaces = new char[] { ' ', '\t', '\r', '\n' }; internal struct UsVsUk @@ -637,19 +635,19 @@ override public void Speak (TextFragment [] frags, IntPtr wfx, ITtsEngineSite si The implementation of -1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. +1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. -2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation +2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation - - Translates Americanism to Britishisms in the text to be spoken. + - Translates Americanism to Britishisms in the text to be spoken. - - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. + - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. The parameters on , including are used to log the event generated through the `LogSpeechEvent` method. -3. A speech rendering engine is then called with the modified array. +3. A speech rendering engine is then called with the modified array. -``` +```csharp private const int WordBoundaryFlag = 1 << (int)TtsEventId.WordBoundary; private readonly char[] spaces = new char[] { ' ', '\t', '\r', '\n' }; internal struct UsVsUk @@ -748,19 +746,19 @@ override public void Speak (TextFragment [] frags, IntPtr wfx, ITtsEngineSite si The implementation of -1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. +1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. -2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation +2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation - - Translates Americanism to Britishisms in the text to be spoken. + - Translates Americanism to Britishisms in the text to be spoken. - - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. + - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. The parameters on , including are used to log the event generated through the `LogSpeechEvent` method. -3. A speech rendering engine is then called with the modified array. +3. A speech rendering engine is then called with the modified array. -``` +```csharp private const int WordBoundaryFlag = 1 << (int)TtsEventId.WordBoundary; private readonly char[] spaces = new char[] { ' ', '\t', '\r', '\n' }; internal struct UsVsUk diff --git a/xml/System.Speech.Synthesis/SpeechSynthesizer.xml b/xml/System.Speech.Synthesis/SpeechSynthesizer.xml index a6f624016ed..0be3b45585e 100644 --- a/xml/System.Speech.Synthesis/SpeechSynthesizer.xml +++ b/xml/System.Speech.Synthesis/SpeechSynthesizer.xml @@ -54,7 +54,6 @@ The following example is part of a console application that initializes a object and speaks a string. ```csharp - using System; using System.Speech.Synthesis; @@ -80,7 +79,6 @@ namespace SampleSynthesis } } } - ``` ]]> @@ -321,7 +319,6 @@ namespace SampleSynthesis } } } - ``` ]]> @@ -398,17 +395,7 @@ namespace SampleSynthesis Gets the prompt that the is speaking. The prompt object that is currently being spoken. - - - + To be added. @@ -519,7 +506,6 @@ namespace SampleSynthesis } } } - ``` ]]> @@ -621,7 +607,6 @@ namespace SampleSynthesis } } } - ``` ]]> @@ -1170,7 +1155,6 @@ namespace SampleSynthesis } } } - ``` ]]> @@ -1388,7 +1372,6 @@ namespace SampleSynthesis } } } - ``` ]]> @@ -1476,7 +1459,6 @@ namespace SampleSynthesis } } } - ``` ]]> @@ -1910,7 +1892,6 @@ namespace SampleSynthesis } } } - ``` This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . @@ -2120,7 +2101,6 @@ namespace SampleSynthesis } } } - ``` ]]> @@ -2486,7 +2466,6 @@ namespace SampleSynthesis } } } - ``` ]]> @@ -2674,7 +2653,6 @@ namespace SampleSynthesis } } } - ``` ]]>