Export (0) Print
Expand All

ISpEnginePronunciation::Normalize (SAPI 5.3)

Speech API 5.3
Microsoft Speech API 5.3

ISpEnginePronunciation::Normalize

ISpEnginePronunciation::Normalize returns the list of normalized forms for a word. For an example call, see the Remarks section below.


HRESULT Normalize(
   LPCWSTR                *pszWord,
   LPCWSTR                 pszLeftContext,
   LPCWSTR                 pszRightContext,
   LANGID                  LangID,
   SPNORMALIZATIONLIST    *pNormalizationList
);

Parameters

pszWord
[in] The word or term for which normalization is desired (for example, "11.30"). This is case sensitive because the case may have a bearing on normalization. For example, "cat" is always "cat", but "CAT" may also be "C. A. T."; "lea" is always "lea", but may also be "Lea".
pszLeftContext
[in] The left portion of a sentence or phrase in which pszWord is used. See the Remarks section below for more information.
pszRightContext
[in] The right portion of a sentence or phrase in which pszWord is used. See the Remarks section below for more information.
LangID
[in] The ID of the language. This parameter is useful if an engine supports multiple languages. To use the engine's default language, set the ID to 0.
pNormalizationList
[out] Returns a list of alternative normalizations. The application must allocate the SPNORMALIZATIONLIST structure that pNormalizationList points to. The engine will allocate the space for the normalization list itself and provide a pointer to it in pNormalizationList>ppszzNormalizedList. The application is responsible for calling CoTaskMemFree on pNormalizationList>ppszzNormalizedList to release the allocation.

Return values

ValueDescription
S_OKFunction completed successfully.
S_NOTSUPPORTEDIndicates that the engine will not provide normalization for the given input and that pNormalizationList will be set to null.
S_LIMITREACHEDIndicates that the returned list is not exhaustive, but contains as many alternatives as the engine is willing to provide.

Remarks

For example, to normalize "XAML" in the string "Developers should use XAML to build Avalon applications", use a statement like the following:


pPron->Normalize("XAML", "Developers should use", "to build Avalon applications", 0, &pListOfNorms;);

The pszLeftContext and pszRightContextparameters are always case sensitive and either of them can be set to null, in which case the engine ignores the parameter. In addition, the engine may ignore any context string.

Some engines (generally TTS) select normalizations based on the context in which a word is used. The following table lists one example of a selected normalization based on context:

pszWordpszLeftContextpszRightContext
"11.30""The time is"null
Show:
© 2014 Microsoft