Public Member Functions | |
bool | equalChars (wchar_t c1, wchar_t c2) const |
Checks if specified characters are represent same letter. | |
void | expandNumbers (std::wstring &str, bool singleDigits) const |
Replaces numbers with their word representation. | |
std::wstring | getAllChars () const |
Returns all characters of Russian alphabet (in both cases). | |
Lang::CharType | getCharType (wchar_t c) const |
Returns type of specified character. | |
void | load (const std::string &fileName) |
Loads string constants from external file. | |
void | markCapitals (const std::wstring &text, BoolVector &marks) const |
Marks letters to speak separately (usual acronims). | |
RusLang () | |
The default constructor. | |
std::wstring | separate (const std::wstring &text) const |
Inserts additional spaces to better words processing. | |
std::wstring | toLower (const std::wstring &str) const |
Returns lower case of the specified string. | |
wchar_t | toLower (wchar_t ch) const |
Returns lower case of the specified character. | |
std::wstring | toUpper (const std::wstring &str) const |
Returns upper case of the specified string. | |
wchar_t | toUpper (wchar_t ch) const |
Returns upper case of the specified character. | |
virtual | ~RusLang () |
The destructor. |
bool RusLang::equalChars | ( | wchar_t | c1, | |
wchar_t | c2 | |||
) | const [virtual] |
Almost in every language each letter can be represented in different cases and different characters are used. This method checks, if specified characters are represent the same letter.
[in] | c1 | The first character to compare |
[in] | c2 | The second character to compare |
Implements Lang.
void RusLang::expandNumbers | ( | std::wstring & | str, | |
bool | singleDigits | |||
) | const [virtual] |
This method replaces all digits by their words representation with the rules of Russian language. Single digits mode replaces just each digit with corresponding word.
[in/out] | str The string to process | |
[in] | singleDigits | Process each digit as separate number |
Implements Lang.
std::wstring RusLang::getAllChars | ( | ) | const [virtual] |
This method allows you to enumerate all characters used in Russian language.
Implements Lang.
Lang::CharType RusLang::getCharType | ( | wchar_t | c | ) | const [virtual] |
This method allows you to get class of specified character. It returns one of the following values: Lang::UpCase, Lang::LowCase or Lang::Other.
[in] | c | The character to get type of |
Implements Lang.
void RusLang::load | ( | const std::string & | fileName | ) |
This method reads external file and takes from it all string constants necessary for Russian language operations. These constants stored not in source code because it is impossible to use strings not in US-ASCII character set.
[in] | fileName | The name of the file to take constants from |
void RusLang::markCapitals | ( | const std::wstring & | text, | |
BoolVector & | marks | |||
) | const [virtual] |
This method marks characters to speak phonetically . Usually some heuristic or predefined table are used.
[in] | text | The string to process |
[out] | marks | The boolean vector to save marks |
Implements Lang.
std::wstring RusLang::separate | ( | const std::wstring & | text | ) | const [virtual] |
This method inserts additional spaces to split words to avoid using capital letters in the middle of the words. If capital letter are used in the middle of the word this method will insert space before it.
[in] | text | The string to process |
Implements Lang.
std::wstring RusLang::toLower | ( | const std::wstring & | str | ) | const [virtual] |
This method adjusts characters of provided string to lower case.
[in] | str | The string to return lower case of |
Implements Lang.
wchar_t RusLang::toLower | ( | wchar_t | ch | ) | const [virtual] |
This method adjusts provided character to lower case.
[in] | ch | The character to return lower case of |
Implements Lang.
std::wstring RusLang::toUpper | ( | const std::wstring & | str | ) | const [virtual] |
This method adjusts characters of provided string to upper case.
[in] | str | The string to return upper case of |
Implements Lang.
wchar_t RusLang::toUpper | ( | wchar_t | ch | ) | const [virtual] |
This method adjusts provided character to upper case.
[in] | ch | The character to return upper case of |
Implements Lang.