SR_Vocabulary API functions


Detailed Description

A vocabulary maps words to their phonetic representation.


Data Structures

struct  SR_Vocabulary

Vocabulary creation

There are two ways to generate a vocabulary:

1. Load a vocabulary from disk. Phonemes are retrieved from a lookup table, and fall back on a TTP engine if necessary. 2. Create an empty vocabulary. Phonemes are retrieved exclusively from a TTP engine.

SREC_VOCABULARY_API
ESR_ReturnCode 
SR_VocabularyCreate (ESR_Locale locale, SR_Vocabulary **self)
SREC_VOCABULARY_API
ESR_ReturnCode 
SR_VocabularyLoad (const LCHAR *filename, SR_Vocabulary **self)

Functions

SREC_VOCABULARY_API
ESR_ReturnCode 
SR_VocabularySave (SR_Vocabulary *self, const LCHAR *filename)
SREC_VOCABULARY_API
ESR_ReturnCode 
SR_VocabularyAddWord (SR_Vocabulary *self, const LCHAR *word)
SREC_VOCABULARY_API
ESR_ReturnCode 
SR_VocabularyGetLanguage (SR_Vocabulary *self, ESR_Locale *locale)
SREC_VOCABULARY_API
ESR_ReturnCode 
SR_VocabularyDestroy (SR_Vocabulary *self)
SREC_VOCABULARY_API
ESR_ReturnCode 
SR_VocabularyGetPronunciation (SR_Vocabulary *self, const LCHAR *word, LCHAR *pronunciation, size_t *len)


Function Documentation

SREC_VOCABULARY_API ESR_ReturnCode SR_VocabularyAddWord ( SR_Vocabulary self,
const LCHAR word 
)

Adds word to vocabulary.

Parameters:
self SR_Vocabulary handle
word Word to be added
Todo:
Function purpose is unclear

SREC_VOCABULARY_API ESR_ReturnCode SR_VocabularyCreate ( ESR_Locale  locale,
SR_Vocabulary **  self 
)

Creates an empty Vocabulary using the specified language.

Parameters:
locale 
self SR_Vocabulary handle

SREC_VOCABULARY_API ESR_ReturnCode SR_VocabularyDestroy ( SR_Vocabulary self  ) 

Destroys a Vocabulary.

Parameters:
self SR_Vocabulary handle

SREC_VOCABULARY_API ESR_ReturnCode SR_VocabularyGetLanguage ( SR_Vocabulary self,
ESR_Locale locale 
)

Returns vocabulary locale.

Parameters:
self SR_Vocabulary handle
locale [out] Vocabulary locale

SREC_VOCABULARY_API ESR_ReturnCode SR_VocabularyGetPronunciation ( SR_Vocabulary self,
const LCHAR word,
LCHAR pronunciation,
size_t *  len 
)

Looks up a word to vocabulary.

Parameters:
self SR_Vocabulary handle
word Word to be added
pronunciation resulting pronunication
len [in/out] Length of phoeme argument. If the return code is ESR_BUFFER_OVERFLOW, the required length is returned in this variable.

SREC_VOCABULARY_API ESR_ReturnCode SR_VocabularyLoad ( const LCHAR filename,
SR_Vocabulary **  self 
)

Loads a vocabulary from file.

Parameters:
self SR_Vocabulary handle
filename File to read from
Todo:
In the future, read language from the underlying vocabulary file

SREC_VOCABULARY_API ESR_ReturnCode SR_VocabularySave ( SR_Vocabulary self,
const LCHAR filename 
)

Saves a vocabulary to file.

Parameters:
self SR_Vocabulary handle
filename File to write to


Generated on Thu May 1 15:37:26 2008 for SREC by  doxygen 1.5.3