CHMlib Logo Leading Translation Management System for Translation Agencies, Top Translation Management Software for Freelance Translators, Time Tracking Software, Word Count, Character Count and Line Count Software, Computer Assisted Translation Tool for Easy Word Count, Clipboard Character Count Software, User-Friendly Translation Memory Software, Terminology Management Software, Terminology Management Server, Microsoft Glossary Software, Dictionary of Acronyms, Social Network for Translators and Translation Agencies, Acronyms and Abbreviations Search Engine, Russian Translation Lab, Ukrainian Translation Lab.
You are reading help file online using chmlib.com
CrisisHelper - First Aid in Tough Times of World Economic Crisis


The Microsoft.com Speech website Microsoft Speech SDK

SAPI 5.1

ISpLexicon::GetPronunciations

ISpLexicon::GetPronunciations gets pronunciations and parts of speech for a word.

HRESULT GetPronunciations(
   const WCHAR              *pszWord,
   LANGID                    LangID,
   DWORD                     dwFlags,
   SPWORDPRONUNCIATIONLIST  *pWordPronunciationList
);

Parameters

pszWord
[in] Pointer to a null-terminated text string as a search keyword. Length must be equal to less than SP_MAX_WORD_LENGTH.
LangID
[in] The language ID of the word. May be zero to indicate that the word can be of any LANGID.
dwFlags
[in] Bitwise flags of type SPLEXICONTYPE indicating that the lexicons searched for this word.
pWordPronunciationList
[in, out] Pointer to SPWORDPRONUNCIATIONLIST structure in which the pronunciations and parts of speech are returned.

Return values

Value Description
S_OK Function completed successfully.
SP_WORD_EXISTS_WITHOUT_PRONUNCIATION The word exists but does not have a pronunciation.
E_POINTER pWordPronunciationList is not a valid write pointer.
E_INVALIDARG At least one of the parameters is invalid or bad.
E_OUTOFMEMORY Exceeded available memory.
SPERR_UNINITIALIZED The interface has not been initialized.
SPERR_NOT_IN_LEX Word is not found in the lexicon.
FAILED(hr) Appropriate error message.

Example

The following example is a code fragment demonstrating the use of GetPronunciations.

        SPWORDPRONUNCIATIONLIST spwordpronlist; 
        memset(&spwordpronlist, 0, sizeof(spwordpronlist)); 
        
        hr = pISpLexicon->GetPronunciations(L"resume", 409, eLEXTYPE_USER | eLEXTYPE_APP, &spwordpronlist);
        //test for results
        if( !SUCCEEDED(hr)) return;
        
        for (
             SPWORDPRONUNCIATION pwordpron = pwordpronlist->pFirstWordPron;
             wordpron != NULL;
             wordpron = pwordpron->pNextWordPron
               )
        {
            DoSomethingWith(pwordpron->ePartOfSpeech, pwordpron->szPronunciation);
        }
        
        //free all the buffers
        CoTaskMemFree(spwordpronlist.pvBuffer);


You are reading help file online using chmlib.com

If you want your help file to be removed or added please send e-mail to chmlibcom@gmail.com
Partner sites: Logo Design, Simple Anti-Crisis Accounting Software, Voice Search for Web