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

SPWORDPRONUNCIATIONLIST

SPWORDPRONUNCIATIONLIST is used with ISpLexicon::GetPronunciations to list possible variations in pronunciation for a given word.

typedef struct SPWORDPRONUNCIATIONLIST
{
    ULONG                   ulSize;
    BYTE                   *pvBuffer;
    SPWORDPRONUNCIATION    *pFirstWordPronunciation;
} SPWORDPRONUNCIATIONLIST;

Members

ulSize
Size of the pronunciation buffer, in bytes.
pvBuffer
Pointer to the buffer for all pronunciations.
pFirstWordPronunciation
Pointer to the first in a linked list of SPWORDPRONUNCIATION structures within pvBuffer.

Remarks

This structure is the start of a linked list of SPWORDPRONUNCIATION structures and contains the size and actual buffer of all subsequent pronunciations.

Call ZeroMemory before using SPWORDPRONUNCIATIONLIST to initialize it, and call CoTaskMemFree(spwordpronlist.pvBuffer) to free the buffer allocated during the calls. The pvBuffer need not (and should not) be freed between the calls.  ISpLexicon::GetPronunciations will reuse the buffer for efficiency and reallocate when necessary.

Example

The following example is a code fragment demonstrating the use and creation of SPWORDPRONUNCIATIONLIST.

    SPWORDPRONUNCIATIONLIST spwordpronlist;
    memset(spwordpronlist, 0, sizeof(spwordpronlist));

    pISpLexicon->GetPronunciations(L"resume", 0, 0, &spwordpronlist);
    for (SPWORDPRONUNCIATION *pwordpron = spwordpronlist.pFirstWordPronunciation;
         wordpron != NULL;
         wordpron = pwordpron->pNextWordPronunciation)
    {
        DoSomethingWith(pwordpron->ePartOfSpeech, pwordpron->szPronunciation);
    }

    pISpLexicon->GetPronunciations(L"record", 0, 0, &spwordpronlist);
    // repeat the for loop above to process the pronunciations

    CoTaskMemFree(spwordpronlist.pvBuffer);

The following helper class will ensure the correct usage of SPWORDPRONUNCIATIONLIST.

class CSpPronList : public SPWORDPRONUNCIATIONLIST
{
public:
    CSpPronList()
    {
        ZeroMemory(static_cast<SPWORDPRONUNCIATIONLIST*>(this), sizeof(SPWORDPRONUNCIATIONLIST));
    }
    ~CSpPronList()
    {
        CoTaskMemFree(pvBuffer);
    }
};

Using the helper class, the above sample becomes:

    CSpPronList spwordpronlist;

    pISpLexicon->GetPronunciations(L"resume", 0, 0, &spwordpronlist);
    for (SPWORDPRONUNCIATION *pwordpron = spwordpronlist.pFirstWordPronunciation;
         wordpron != NULL;
         wordpron = pwordpron->pNextWordPronunciation)
    {
        DoSomethingWith(pwordpron->ePartOfSpeech, pwordpron->szPronunciation);
    }

    pISpLexicon->GetPronunciations(L"record", 0, 0, &spwordpronlist);
    // repeat the for loop above to process the pronunciations

 



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