Beispiel #1
0
 _size_t_ getVowelPos (ustring ch) {
     _size_t_ pos = VowelsWithAccents.find (ch.lowercase ());
     if (pos != ustring::npos)
         pos /= NUMBER_OF_ACCENTS;
     else if (Vowels.find (ch.lowercase ()) != pos)
         pos = Vowels.find (ch.lowercase ());
     return pos;
 }
Beispiel #2
0
    _size_t_ getMarkedCharPos (ustring ch) {
        _size_t_ mark =
            LettersWithMarks.find (removeAccentFromChar (ch.lowercase ()));

        if (mark != ustring::npos)
            mark %= LettersWithoutMarks.length ();

        return mark;
    }
Beispiel #3
0
    Accents getAccentFromChar (ustring ch) {
        _size_t_ accent = VowelsWithAccents.find (ch.lowercase ());

        if (accent != ustring::npos)
            accent %= NUMBER_OF_ACCENTS;
        else
            accent = NO_ACCENT;

        return accent;
    }
Beispiel #4
0
    ustring removeAccentFromChar (ustring ch) {
        bool isUp = isUpperCase (ch);
        ch = ch.lowercase ();

        _size_t_ posVowel = getVowelPos (ch);
        if (posVowel != ustring::npos)
            ch = _(Vowels[posVowel]);

        if (isUp)
            ch = ch.uppercase ();
        return ch;
    }
Beispiel #5
0
    ustring addAccentToChar (ustring ch, Accents accent) {
        bool isUp = isUpperCase (ch);
        ch = ch.lowercase ();

        _size_t_ pos = Vowels.find (ch);
        if (pos != ustring::npos)
            ch = _(VowelsWithAccents[pos * NUMBER_OF_ACCENTS + accent]);

        if (isUp)
            ch = ch.uppercase ();
        return ch;
    }
Beispiel #6
0
 bool operator() (const ustring& str1, const ustring& str2) const {
     if (str1.length() >= str2.length() && str2.lowercase() == str1.substr(0, str2.length()).lowercase())
           return false;
     else
           return true;
 }
Beispiel #7
0
 bool isWordBreak (ustring ch, guint BackspaceChar) {
     // A char is a word-break if and only if tt's a non-letter
     // character and not a Backspace.
     return !isLetter (ch.lowercase ()) && ch != _(BackspaceChar);
 }
Beispiel #8
0
 bool isVowel (ustring ch) {
     return PlainVowels.find (toPlainLetter (ch.lowercase ()))
         != ustring::npos;
 }