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

ISpRecoGrammar::IsPronounceable

ISpRecoGrammar::IsPronounceable calls the SR engine object to determine if the word has a pronunciation.

HRESULT IsPronounceable(
   const WCHAR         *pszWord,
   SPWORDPRONOUNCEABLE *pfPronounceable
);

Parameters

pszWord
[in, string] The word to test. Length must be equal to or less than SP_MAX_WORD_LENGTH.
pfPronounceable
[out] Flag, from among the following list, indicating the if the word is pronounceable by the SR engine. See Remarks section.
Value
SPWP_UNKNOWN_WORD_UNPRONOUNCEABLE The word is not pronounceable by the SR engine, and is not located in the lexicon and/or the engine's dictionary.
SPWP_UNKNOWN_WORD_PRONOUNCEABLE The word is pronounceable by the SR engine, but is not located in the lexicon and/or the engine's dictionary. 
SPWP_KNOWN_WORD_PRONOUNCEABLE The word is pronounceable by the SR engine, and is located in the lexicon and/or the engine's dictionary.

Return values

Value Description
S_OK Function completed successfully.
E_POINTER Either pszWord or pfPronounceable is invalid or bad.
FAILED (hr) Appropriate error message.

Remarks

The exact implementation and usage for the SR engine's dictionary and pronounceable words may vary between engines. For example, an SR engine may attempt to pronounce all words passed using ::IsPronounceable, even if it is not located in the lexicon or the dictionary, it would rarely or never, return SPWP_UNKNOWN_WORD_UNPRONOUNCEABLE.

Typically, there are two scenarios when an application might use the method ::IsPronounceable.

If an application is using a number of specialized or uncommon words (e.g., legal, medical, or scientific terms), the application may want to verify that the words are contained in either the lexicon (see also ISpLexicon) or the SR engine's dictionary. If the words are not contained in the lexicon or the dictionary (even if they are pronounceable), the application can add them to the lexicon to improve the chances of a successful recognition.

An application may also want to verify that the SR engine will actually recognize the words in a CFG (even though loading the CFG succeeded). If the SR engine returns SPWP_UNKNOWN_WORD_UNPRONOUNCEABLE, the application can update the lexicon pronunciation entry (see ISpLexicon).


See also ISpSREngine::IsPronounceable for more information on the SR engine's role.

Example

The following code snippet illustrates the use of ISpRecoGrammar:IsPronounceable. The words used are examples only, as the pronounceability by different SR engines may vary. See Remarks section.


    HRESULT hr = S_OK;

    // check if a common word is pronounceable
    hr = cpRecoGrammar->IsPronounceable(L"hello", &wordPronounceable);
    // Check hr

    // wordPronounceable is probably equal to SPWP_KNOWN_WORD_PRONOUNCEABLE

    // check if an uncommon, or imaginary, word is pronounceable
    hr = cpRecoGrammar->IsPronounceable(L"snork", &wordPronounceable);
    // Check hr

    // wordPronounceable is probably equal to SPWP_UNKNOWN_WORD_PRONOUNCEABLE

    // check if a non-word, or imaginary, word is unpronounceable
    hr = cpRecoGrammar->IsPronounceable(L"lpdzsd", &wordPronounceable);
    // Check hr

    // wordPronounceable is probably equal to SPWP_UNKNOWN_WORD_UNPRONOUNCEABLE


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