Skip to content

Instantly share code, notes, and snippets.

/f.p6

Created September 4, 2017 05:36
Show Gist options
  • Save anonymous/fc6f6a3e4968e1ce59f4a823549b360a to your computer and use it in GitHub Desktop.
Save anonymous/fc6f6a3e4968e1ce59f4a823549b360a to your computer and use it in GitHub Desktop.
sub conj(Str $λ, Str $f where 'pol'|'neg'|'par'|'pef'|'pot'|'con'|'vol') {
given $f {
when 'pol' {
(given $λ {
when s/ 'う'$ / 'い' / {$_}
when s/ 'つ'$ / 'ち' / {$_}
when s/ 'く'$ / 'き' / {$_}
when s/ 'ぐ'$ / 'ぎ' / {$_}
when s/ 'ぶ'$ / 'び' / {$_}
when s/ 'む'$ / 'み' / {$_}
when s/ 'す'$ / 'し' / {$_}
when s/ ['い'|'え']'る'$ / / {$_}
when s/ 'する'$ / 'し' / {$_}
when s/ 'くる'$ / 'き' / {$_}
when s/ 'る'$ / 'り' / {$_}
}
) ~ 'ます'
}
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment