Note

Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.

RecognizedPhrase.Homophones Property

Gets a collection of the recognition alternates that have the same pronunciation as this recognized phrase.

Namespace:  Microsoft.Speech.Recognition
Assembly:  Microsoft.Speech (in Microsoft.Speech.dll)

Syntax

'Declaration
Public ReadOnly Property Homophones As ReadOnlyCollection(Of RecognizedPhrase)
    Get
'Usage
Dim instance As RecognizedPhrase
Dim value As ReadOnlyCollection(Of RecognizedPhrase)

value = instance.Homophones
public ReadOnlyCollection<RecognizedPhrase> Homophones { get; }

Property Value

Type: System.Collections.ObjectModel.ReadOnlyCollection<RecognizedPhrase>
A read-only collection of the recognition alternates that have the same pronunciation as this recognized phrase.

Remarks

This property returns all other recognition alternates that have the same pronunciation as this recognized phrase.

For example, for a recognition result that contained the alternates, "the tale" and "the tail", the homophones collection for the first alternate, "the tale", would contain the second phrase, "the tail". The homophones collection for the second alternate, "the tail", would contain the first phrase, "the tale".

Examples

The code fragment and utility method shown below display the Text property of the RecognizedPhrase instances returned by the Homophones property to a ListControl on a user interface.

Utils.DisplayDataOnListBox(_recognizedPhraseHomophonesListBox, _recognizedPhrase.Homophones, "Text");

/*
 */
// Updates alternates list with alternates of the result.
internal static void DisplayDataOnListBox(ListControl list, object dataSource, string displayMember) 
{
  list.DataSource = dataSource; //result.Alternates;
  list.DisplayMember = displayMember; //"Text";
}

See Also

Reference

RecognizedPhrase Class

RecognizedPhrase Members

Microsoft.Speech.Recognition Namespace