From 4c774d079a14d543bafb822f1d9774100b886f65 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 24 Dec 2022 14:39:53 -0300 Subject: [PATCH] fix(romaji.c): fix a bug where some shells would get tipsy with newlines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit up(romaji.h): add support for `v` and direct access to lower vowel kana via `l` (e.g la -> ぁ) --- romaji.c | 2 +- romaji.h | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 87 insertions(+), 4 deletions(-) diff --git a/romaji.c b/romaji.c index 4ed0f19..7516662 100644 --- a/romaji.c +++ b/romaji.c @@ -288,7 +288,7 @@ int main (int argc, char** argv) { } if (argc > 1) { - write (1, "\n", 2); + //write (1, "\n", 2); free (bufout); } else { diff --git a/romaji.h b/romaji.h index 0ed4623..99db685 100644 --- a/romaji.h +++ b/romaji.h @@ -53,6 +53,8 @@ enum JA_CONSONANTS { _Z = 'z' ascii, _Q = 'q' ascii, _X = 'x' ascii, + _L = 'l' ascii, + _V = 'v' ascii, }; typedef enum JA_CONSONANTS jconson; @@ -104,9 +106,15 @@ const jtableman jvman = { ._ALT = DONT, }; -//const jtableman* jsman[] = { -// &jyman, &jvman, -//}; +const jtableman jkman = { + ._ = DONT, + ._a = "ぁ", + ._i = "ぃ", + ._u = "ぅ", + ._e = "ぇ", + ._o = "ぉ", + ._ALT = DONT, +}; const jtable jman[] = { [_ ASCII] = { @@ -134,6 +142,81 @@ const jtable jman[] = { }, }, + [_X] = { + .comp = { + .it = true, + .y = { + .it = _ALT, + .as = &jyman, + }, + .conson = { + .it = _K, + .base = _ALT, + .ign = DONT, + .as = &jkman, + }, + }, + .man = { + ._ = DONT, + ._a = "ぁ", + ._i = "ぃ", + ._u = "ぅ", + ._e = "ぇ", + ._o = "ぉ", + ._ALT = DONT, + }, + }, + + [_L] = { + .comp = { + .it = true, + .y = { + .it = _ALT, + .as = &jyman, + }, + .conson = { + .it = _K, + .base = _ALT, + .ign = DONT, + .as = &jkman, + }, + }, + .man = { + ._ = DONT, + ._a = "ぁ", + ._i = "ぃ", + ._u = "ぅ", + ._e = "ぇ", + ._o = "ぉ", + ._ALT = DONT, + }, + }, + + [_V] = { + .comp = { + .it = true, + .y = { + .it = _U, + .as = &jyman, + }, + .conson = { + .it = DONT, + .base = DONT, + .ign = DONT, + .as = NULL, + }, + }, + .man = { + ._ = DONT, + ._a = "ゔぁ", + ._i = "ゔぃ", + ._u = "ゔ", + ._e = "ゔぇ", + ._o = "ゔぉ", + ._ALT = DONT, + }, + }, + [_Y] = { .comp = { .it = true,