korean: ㄳ from two consonants, 가 from a vowel typed first; index jamo by scanning

libhangul, and so fcitx5-hangul, joins two lone consonants into the
compound jong they make (rt → ㄳ, split again by a vowel: rtk → ㄱ사),
and by default reorders a vowel typed before its consonant (kr → 가);
strans committed the first jamo and started over.  Backspace on a lone
ㄳ leaves ㄱ, as on a syllable.

The three jamo index tables and their -1 macros were the cho, jung, and
jong arrays inverted by hand, bounded by a Jrange the callers had to
respect; a linear scan of the arrays says the same in ten lines.
This commit is contained in:
2026-08-17 01:22:52 +09:00
parent f0498868eb
commit 1285476b41
2 changed files with 40 additions and 46 deletions

View File

@@ -25,6 +25,12 @@ korean_sequences(struct ct *t)
{ "rr", "ㄱㄱ" },
{ "Rk", "" },
{ "rk1", "가1" },
{ "rt", "" },
{ "rtk", "ㄱ사" },
{ "rtt", "ㄳㅅ" },
{ "kr", "" },
{ "hkr", "" },
{ "kk", "ㅏㅏ" },
};
Str out;
int i;
@@ -81,6 +87,7 @@ korean_backspace(struct ct *t)
{
static const struct { char *before, *after; } cases[] = {
{ "", "" },
{ "", "" },
{ "", "" },
{ "", "" }, { "", "" }, { "", "" },
{ "", "" }, { "", "" }, { "", "" },