Compartilhar via


Note

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

Microsoft Speech Platform

ISpEnginePronunciation::Normalize

ISpEnginePronunciation::Normalize returns the list of normalized forms for a word.

<pre IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml"> <strong>HRESULT Normalize(</strong> <strong> LPCWSTR</strong> *<em>pszWord</em>, <strong> LPCWSTR</strong> <em>pszLeftContext</em>, <strong> LPCWSTR</strong> <em>pszRightContext</em>, <strong> LANGID</strong> <em>LangID</em>, <strong> <a runat="server" href="jj127871(v=msdn.10).md">SPNORMALIZATIONLIST</a></strong> *<em>pNormalizationList</em> <strong>);</strong> </pre>

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. Can be NULL.
  • pszRightContext
    [in] The right portion of a sentence or phrase in which pszWord is used. Can be NULL.
  • 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

Value Description
S_OK Function completed successfully.
E_INVALIDARG Indicates that the engine will not provide normalization for the given input and that pNormalizationList will be set to NULL.
S_LIMITREACHED Indicates that the returned list is not exhaustive, but contains as many alternatives as the engine is willing to provide.

Remarks

Specifying pszLeftContext and pszRightContext may improve the accuracy of the normalization result, provided the speech engine supports these parameters. The pszLeftContext and pszRightContext parameters 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.