Public Member Functions | |
void | addReplacement (LangId langId, const std::wstring &oldValue, const std::wstring &newValue) |
Adds new text replacement. | |
void | associate (const std::wstring &str, LangId langId) |
Specifies the characters to be processed by specified language. | |
void | process (const TextItem &text, std::list< TextItem > &items) const |
Processes text before speaking. | |
void | processLetter (wchar_t c, TextParam volume, TextParam pitch, TextParam rate, TextItemList &items) const |
Processes single letter. | |
void | setDefaultLangId (LangId langId) |
Sets new value for default language. | |
void | setMode (int digitsMode, bool capitalization, bool separation) |
Sets some text processing parameters. | |
void | setSpecialValueFor (wchar_t c, const std::wstring &value) |
Set special value to describe character. | |
TextProcessor (const AbstractLangIdResolver &langIdResolver) | |
The constructor. | |
virtual | ~TextProcessor () |
The destructor. |
TextProcessor::TextProcessor | ( | const AbstractLangIdResolver & | langIdResolver | ) | [inline] |
[in] | langIdResolver | The class to translate language identifiers to a valid language objects |
void TextProcessor::addReplacement | ( | LangId | langId, | |
const std::wstring & | oldValue, | |||
const std::wstring & | newValue | |||
) | [virtual] |
This method adds new replacement, associated with some language.
[in] | langId | The ID of a language to add replacement for |
[in] | oldValue | The text to be replaced |
[in] | newValue | The text to replace with |
Implements AbstractTextProcessor.
void TextProcessor::associate | ( | const std::wstring & | str, | |
LangId | langId | |||
) | [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.
[in] | str | Teh string of characters to associate with language |
[in] | langId | The ID of a language to associate with |
Implements AbstractTextProcessor.
void TextProcessor::process | ( | const TextItem & | text, | |
std::list< TextItem > & | items | |||
) | const [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.
[in] | text | The text to process |
[out] | items | The reference to text item list to receive a result |
Implements AbstractTextProcessor.
void TextProcessor::processLetter | ( | wchar_t | c, | |
TextParam | volume, | |||
TextParam | pitch, | |||
TextParam | rate, | |||
TextItemList & | items | |||
) | const [virtual] |
This method handles the "LETTER" command and generates corresponding text item.
[in] | c | The character to process |
[in] | volume | The desired volume value |
[in] | pitch | The desired pitch value |
[in] | rate | The desired rate value |
[out] | items | The reference to text item list to receive a result |
Implements AbstractTextProcessor.
void TextProcessor::setDefaultLangId | ( | LangId | langId | ) | [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.
[in] | langId | The new default language ID |
Implements AbstractTextProcessor.
void TextProcessor::setMode | ( | int | digitsMode, | |
bool | capitalization, | |||
bool | separation | |||
) |
This method sets some text processing parameters. Digits mode means how numbers must be processed. There are three variants: replace by usual words representation, replace each digit by corresponding single word or do nothing and let speech synthesizer process numbers by itself. Used word "Capitalization" is not proper term. It means invocation of language-specific function to mark letters for phonetic pronunciation. Separation feature inserts space after any non-capital letter followed by capital letter (for example, can be very useful for Hungarian notation processing).
[in] | digitsMode | The mode of digits processing (can be DigitsModeNormal, DigitsModeSingle or DigitsModeNone) |
[in] | capitalization | The capitalization mode |
[in] | separation | The separation mode |
void TextProcessor::setSpecialValueFor | ( | wchar_t | c, | |
const std::wstring & | value | |||
) | [virtual] |
Special value is used to describe the single letter on corresponding letter command.
[in] | c | The character to set value for |
[in] | value | The value to set |
Implements AbstractTextProcessor.