VoiceMan
Public Member Functions
AbstractTextProcessor Class Reference

The unified interface for all text processors. More...

Inheritance diagram for AbstractTextProcessor:
TextProcessor

List of all members.

Public Member Functions

virtual void addReplacement (LangId langId, const std::wstring &oldValue, const std::wstring &newValue)=0
 Adds new text replacement.
virtual void associate (const std::wstring &str, LangId langId)=0
 Specifies the characters to be processed by specified language.
virtual void process (const TextItem &text, std::list< TextItem > &items) const =0
 Processes text before speaking.
virtual void processLetter (wchar_t c, TextParam volume, TextParam pitch, TextParam rate, TextItemList &items) const =0
 Processes single letter.
virtual void setDefaultLangId (LangId langId)=0
 Sets new value for default language.
virtual void setSpecialValueFor (wchar_t c, const std::wstring &value)=0
 Set special value to describe character.
virtual ~AbstractTextProcessor ()
 The destructor.

Detailed Description

This class declares abstract interface for text processors. Currently there is only one implementation, but there can be more in future.

See also:
TextProcessor

Member Function Documentation

virtual void AbstractTextProcessor::addReplacement ( LangId  langId,
const std::wstring &  oldValue,
const std::wstring &  newValue 
) [pure virtual]

This method adds new replacement, associated with some language.

Parameters:
[in]langIdThe ID of a language to add replacement for
[in]oldValueThe text to be replaced
[in]newValueThe text to replace with
See also:
Replacement

Implemented in TextProcessor.

virtual void AbstractTextProcessor::associate ( const std::wstring &  str,
LangId  langId 
) [pure virtual]

This method selects which characters must be processed by some language. Note, the language ID can have LANG_ID_NONE value. It means to process characters by the same language as preceding text.

Parameters:
[in]strTeh string of characters to associate with language
[in]langIdThe ID of a language to associate with

Implemented in TextProcessor.

virtual void AbstractTextProcessor::process ( const TextItem text,
std::list< TextItem > &  items 
) const [pure virtual]

This method splits text string onto sequence of text items regarding current language settings. Produced items is almost ready to be sent to speech sinthesizer but exact output is not selected. It must be choosed explicitly according with current client preferences.

Parameters:
[in]textThe text to process
[out]itemsThe reference to text item list to receive a result

Implemented in TextProcessor.

virtual void AbstractTextProcessor::processLetter ( wchar_t  c,
TextParam  volume,
TextParam  pitch,
TextParam  rate,
TextItemList &  items 
) const [pure virtual]

This method handles the "LETTER" command and generates corresponding text item.

Parameters:
[in]cThe character to process
[in]volumeThe desired volume value
[in]pitchThe desired pitch value
[in]rateThe desired rate value
[out]itemsThe reference to text item list to receive a result

Implemented in TextProcessor.

virtual void AbstractTextProcessor::setDefaultLangId ( LangId  langId) [pure virtual]

This method sets new value for default language. Some characters can be marked to be processed by the language of precedent text. Default language is used if such characters was met but there is no preceding text.

Parameters:
[in]langIdThe new default language ID

Implemented in TextProcessor.

virtual void AbstractTextProcessor::setSpecialValueFor ( wchar_t  c,
const std::wstring &  value 
) [pure virtual]

Special value is used to describe the single letter on corresponding letter command.

Parameters:
[in]cThe character to set value for
[in]valueThe value to set

Implemented in TextProcessor.