ISpeechPhraseReplacement Interface (SAPI 5.3)
The ISpeechPhraseReplacement automation interface specifies a replacement, or text normalization, of one or more spoken words in a recognition result.
For example, the spoken words "twenty three" might be replaced by the replacement text "23."
Recognition results are returned in an ISpeechRecoResult, which contains an ISpeechPhraseInfo object. The ISpeechPhraseInfo has two properties which are closely related. Its Elements property is a collection of ISpeechPhraseElement objects; its Replacements property is a collection of ISpeechPhraseReplacement objects. An ISpeechPhraseReplacement object is related to and dependent on the phrase elements in the recognition result which contains it.
Use of the ISpeechPhraseReplacement is demonstrated in a code example at the end of this section.
Automation Interface Elements
The ISpeechPhraseReplacement automation interface contains the following elements:
|DisplayAttributes Property||Returns a set of SpeechDisplayAttributes constants specifying information about the display of this word.|
|FirstElement Property||Returns the offset of the first spoken element to be replaced.|
|NumberOfElements Property||Returns the number of spoken elements to replaced.|
|Text Property||Returns the text of the replacement.|