Beispiel #1
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 #2
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 #3
0
    ustring removeMarkFromChar (ustring ch) {
        bool isUp = isUpperCase (ch);

        _size_t_ pos = getMarkedCharPos (ch);
        _size_t_ accent = getAccentFromChar (ch);

        if (pos != ustring::npos)
            ch = addAccentToChar (_(LettersWithoutMarks[pos]), accent);

        if (isUp)
            ch = ch.uppercase ();
        return ch;
    }
Beispiel #4
0
    ustring addMarkToChar (ustring ch, Marks mark) {
        bool isUp = isUpperCase (ch);
        _size_t_ accent = getAccentFromChar (ch);

        _size_t_ pos = LettersMayChangeMarks.find
            (removeAccentFromChar (ch).lowercase ());
        if (pos != ustring::npos) {
            ch = addAccentToChar
                (_(LettersWithMarks
                   [mark * LettersWithoutMarks.length () + pos]),
                 accent);
            if (isUp)
                ch = ch.uppercase ();
        }
        return ch;
    }
Beispiel #5
0
 bool isUpperCase (ustring ch) {
     return ch.uppercase () == ch;
 }