damienleroy / PowerAccent

Easily create accented letters with all type of keyboard (QWERTY, AZERTY, others...)
MIT License
116 stars 21 forks source link

Support for Tâi-Lô and POJ characters (Taiwan Min) #30

Open NightFurySL2001 opened 2 years ago

NightFurySL2001 commented 2 years ago

Tâi-Lô and Pe̍h-ōh-jī are transliterations used for Hokkien (Min language) and Hakka in Taiwan, which requires extensive support for accented characters and Unicode character combinations. (mentioned at https://github.com/damienleroy/PowerAccent/issues/10#issuecomment-1242434735)

jmonticolo commented 1 year ago

The next tables are accented characters extracted from the two Wikipedia links provided :

Base letter/Tone 1 Tone 2 Tone 3 Tone 5 Tone 6 Tone 7 Tone 8 Tone 9
a á à â ǎ ā
e é è ê ě ē
i í ì î ǐ ī
o ó ò ô ǒ ō ő
u ú ù û ǔ ū ű
m ḿ
n ń ǹ ň
Base letter/Tone 1 Tone 2 Tone 3 Tone 4 Tone 5 Tone 7 Tone 8 Variant
a á à â ā ă
e é è ê ē ĕ
i í ì î ī ĭ
o ó ò ô ō ŏ
u ú ù û ū ŭ
m ḿ
n ń ǹ
ó͘ ò͘ ô͘ ō͘ o̍͘ ŏ͘

So :

    //Tâi-Lô
    private static char[] GetDefaultLetterKeyTL(LetterKey letter)
    {
        switch (letter)
        {
            case LetterKey.A:
                return new char[] { 'á', 'à', 'â', 'ǎ', 'ā', 'a̍', 'a̋' };
            case LetterKey.E:
                return new char[] { 'é', 'è', 'ê', 'ě', 'ē', 'e̍', 'e̋' };
            case LetterKey.I:
                return new char[] { 'í', 'ì', 'î', 'ǐ', 'ī', 'i̍', 'i̋' };
            case LetterKey.O:
                return new char[] { 'ó', 'ò', 'ô', 'ǒ', 'ō', 'o̍', 'ő' };
            case LetterKey.U:
                return new char[] { 'ú', 'ù', 'û', 'ǔ', 'ū', 'u̍', 'ű' };
            case LetterKey.M:
                return new char[] { 'ḿ', 'm̀', 'm̂', 'm̌', 'm̄', 'm̍', 'm̋' };
            case LetterKey.N:
                return new char[] { 'ń', 'ǹ', 'n̂', 'ň', 'n̄', 'n̍', 'n̋' };
        }

        return Array.Empty<char>();
    }

    //Pe̍h-ōh-jī
    private static char[] GetDefaultLetterKeyPJ(LetterKey letter)
    {
        switch (letter)
        {
            case LetterKey.A:
                return new char[] { 'á', 'à', 'â', 'ā', 'a̍', 'ă' };
            case LetterKey.E:
                return new char[] { 'é', 'è', 'ê', 'ē', 'e̍', 'ĕ' };
            case LetterKey.I:
                return new char[] { 'í', 'ì', 'î', 'ī', 'i̍', 'ĭ' };
            case LetterKey.O:
                return new char[] { 'ó', 'ò', 'ô', 'ō', 'o̍', 'ŏ', 'ó͘', 'ò͘', 'o͘', 'ô͘', 'ō͘', 'o̍͘', 'ŏ͘' };
            case LetterKey.U:
                return new char[] { 'ú', 'ù', 'û', 'ū', 'u̍', 'ŭ' };
            case LetterKey.M:
                return new char[] { 'ḿ', 'm̀', 'm̂', 'm̄', 'm̍', 'm̆' };
            case LetterKey.N:
                return new char[] { 'ń', 'ǹ', 'n̂', 'n̄', 'n̍', 'n̆' };
        }

        return Array.Empty<char>();
    }
NightFurySL2001 commented 1 year ago

Peh-oh-ji o dot tone 8 seem to be missing the dot.

damienleroy commented 1 year ago

Open it again. Issue not resolved. I had to revert the modifications. Therefore, I will create a release (2.0.0) without it, but it will be included in a future release. The pull request asks to: