Skip to content

Commit

Permalink
fix(romaji.c): fix a bug where some shells would get tipsy with newlines
Browse files Browse the repository at this point in the history
up(romaji.h): add support for `v` and direct access to lower vowel kana
              via `l` (e.g la -> ぁ)
  • Loading branch information
matthmr committed Dec 24, 2022
1 parent 656eaf4 commit 4c774d0
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 4 deletions.
2 changes: 1 addition & 1 deletion romaji.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ int main (int argc, char** argv) {
}

if (argc > 1) {
write (1, "\n", 2);
//write (1, "\n", 2);
free (bufout);
}
else {
Expand Down
89 changes: 86 additions & 3 deletions romaji.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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] = {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 4c774d0

Please sign in to comment.