Lang Class Reference
The abstract class to unify all language processing objects.
Inherited by EngLang, and RusLang.
List of all members.
|
Public Types |
enum | CharType { UPCASE = 0,
LOWCASE = 1,
OTHER = 2
} |
Public Member Functions |
virtual bool | equalChars (wchar_t c1, wchar_t c2) const =0 |
| Checks if specified characters represent same letter.
|
virtual void | expandNumbers (std::wstring &str, bool singleDigits) const =0 |
| Replaces numbers with their word representation.
|
virtual std::wstring | getAllChars () const =0 |
| Returns all characters of this language alphabet (in all cases).
|
virtual CharType | getCharType (wchar_t c) const =0 |
| Returns type of specified character in language of current object.
|
virtual void | markCapitals (const std::wstring &text, BoolVector &marks) const =0 |
| Marks letters to speak separately (usual acronims).
|
virtual std::wstring | separate (const std::wstring &text) const =0 |
| Inserts additional spaces to better words processing.
|
virtual std::wstring | toLower (const std::wstring &str) const =0 |
| Returns string with letters adjusted to lower case.
|
virtual wchar_t | toLower (wchar_t ch) const =0 |
| returns lower case of the specified character
|
virtual std::wstring | toUpper (const std::wstring &str) const =0 |
| Returns string with letters adjusted to upper case.
|
virtual wchar_t | toUpper (wchar_t ch) const =0 |
| Returns upper case of the specified character.
|
virtual | ~Lang () |
| The destructor.
|
Member Function Documentation
virtual bool Lang::equalChars |
( |
wchar_t |
c1, |
|
|
wchar_t |
c2 | |
|
) |
| | const [pure virtual] |
Almost in every language each letter can be represented in different cases and different characters are used to store them. This method checks, if specified characters represent the same letter.
- Parameters:
-
[in] | c1 | The first character to compare |
[in] | c2 | The second character to compare |
virtual void Lang::expandNumbers |
( |
std::wstring & |
str, |
|
|
bool |
singleDigits | |
|
) |
| | const [pure virtual] |
- Parameters:
-
| [in/out] | str The string to process |
[in] | singleDigits | Process each digit as separate number |
virtual CharType Lang::getCharType |
( |
wchar_t |
c |
) |
const [pure virtual] |
- Parameters:
-
[in] | c | The character to get type of |
virtual void Lang::markCapitals |
( |
const std::wstring & |
text, |
|
|
BoolVector & |
marks | |
|
) |
| | const [pure virtual] |
- Parameters:
-
[in] | text | The string to process |
[out] | marks | The boolean vector to save marks |
virtual std::wstring Lang::separate |
( |
const std::wstring & |
text |
) |
const [pure virtual] |
This method inserts additional spaces to split words to avoid using capital letters in the middle of the words. If capital letter used in the middle of the word this method will insert space before it. It is useful for Hungarian notation.
- Parameters:
-
[in] | text | The string to process |
virtual std::wstring Lang::toLower |
( |
const std::wstring & |
str |
) |
const [pure virtual] |
- Parameters:
-
[in] | str | The string to adjust case |
virtual wchar_t Lang::toLower |
( |
wchar_t |
ch |
) |
const [pure virtual] |
- Parameters:
-
[in] | ch | The character to return lower case of |
virtual std::wstring Lang::toUpper |
( |
const std::wstring & |
str |
) |
const [pure virtual] |
- Parameters:
-
[in] | str | The string to adjust case |
virtual wchar_t Lang::toUpper |
( |
wchar_t |
ch |
) |
const [pure virtual] |
- Parameters:
-
[in] | ch | The character to return upper case of |