diff options
author | David Wührer <def@gmx.at> | 2017-02-19 15:23:48 +0100 |
---|---|---|
committer | David Wührer <def@gmx.at> | 2017-02-19 15:23:48 +0100 |
commit | ed28bd25e3055ff9134eb655be37c076f9bf67fe (patch) | |
tree | 9099df56945f4274c21f6a368ab2d431282453eb |
initial commit
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | english | 13 | ||||
-rw-r--r-- | english2uryuomoco.c | 127 | ||||
-rw-r--r-- | test.sh | 7 | ||||
-rw-r--r-- | uryuomoco | 13 | ||||
-rw-r--r-- | uryuomoco.zip | bin | 0 -> 3470 bytes | |||
-rw-r--r-- | uryuomoco2english.c | 157 |
7 files changed, 321 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..fbd23ca --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +all: english2uryuomoco uryuomoco2english + +.PHONY: all + @@ -0,0 +1,13 @@ +alienese +rockape +gun +no, not that! +change back temporarily while using the restroom! +learn a language that… fast??? +cute +lesser chimera +greater chimera +it is time for the end of man +this master of fire shall inherit the earth +my very presence eats awai at your fleac! + diff --git a/english2uryuomoco.c b/english2uryuomoco.c new file mode 100644 index 0000000..e64725c --- /dev/null +++ b/english2uryuomoco.c @@ -0,0 +1,127 @@ +#include <stdio.h> +#include <ctype.h> + +// english to uryuomoco +// abcdefghijklmnopqrstuvwxyz +char trl[]="uvs.ohtf.dprnmekwlcgab.zix"; + +/* + * a->u + * b->v + * c->s + * ch->se h + * d->ja + * e->o + * f->h + * g->t + * gr->tul r + * h->f + * i->yu i? + * ing ->ot in + * j->d + * k->p + * l->r + * ll->ra l + * m->n + * n->m + * no ->meh + * o->e + * p->k + * qu->w u + * r->l + * s->c s? + * sh->us sh + * ss->ais ss + * t->g t? + * th->ch th + * ts->gis ts + * u->a + * v->b + * w->qu + * wh->quo h + * x->z + * y->i + * z->x + */ + +int ing(){ // i + int c=getchar(); + if(c=='n'){ // in + c=getchar(); + if(c=='g'){ // ing + c=getchar(); + if(!islower(c)){ // ing. + putchar('o'); + putchar('t'); + return putchar(c); + }else{ // ing- + putchar('y'); + putchar('u'); + putchar('m'); + putchar('t'); + } + }else{ //in- + putchar('y'); + putchar('u'); + putchar('m'); + } + }else{ // i- + putchar('y'); + putchar('u'); + } + return tr(c); +} + + +int tr(int c){ + int retval; + static int prev=0; + if(islower(c)){ + switch(c){ + case 'd': putchar('j'); retval=putchar('a'); break; // d -> ja + case 'i': retval=ing(); break; + case 'u': if(prev!='q') retval=putchar('a'); break; // qu -> w, u -> a + case 'h': + switch(prev){ + case 'c': retval=putchar('e'); break; // ch -> se + case 's': putchar('u'); retval=putchar('s'); break; // sh -> us + case 't': putchar('c'); retval=putchar('h'); break; // th -> ch + case 'w': retval=putchar('o'); break; // wh -> quo + default: retval=putchar('f'); // h -> f + }break; + case 'l': retval=putchar(prev=='l'?'a':'r'); break; // ll -> ra, l -> r + case 'r': if(prev=='g') putchar('u'); retval=putchar('l'); break; // gr -> tul + case 's': + c=getchar(); + switch(c){ + case 'h': putchar('u'); retval=putchar('s'); break; // sh -> us + case 's': putchar('a'); putchar('i'); retval=putchar('s'); break; // ss -> ais + default: putchar('c'); prev='s'; return(tr(c)); // s -> c + } + break; + case 't': + c=getchar(); + switch(c){ + case 'h': putchar('c'); putchar('h'); break; // th -> ch + case 's': putchar('g'); putchar('i'); putchar('s'); break; // ts -> gis + default: putchar('g'); prev='t'; return(tr(c)); // t -> g + } + break; + case 'w': putchar('q'); retval=putchar('u'); break; // w -> qu + default: retval=putchar(trl[c-'a']); // single to single + } + }else{ + if(prev=='o')putchar('h'); // no ->meh + retval=putchar(c); + } + prev=c; + return retval; +} + +int main(int argc, char** argv){ + char c; + do{ + c=getchar(); + }while(c!=EOF && tr(c)!=EOF); + return 0; +} @@ -0,0 +1,7 @@ +#!/bin/sh + +wd=$( dirname $0 ) + +${wd}/uryuomoco2english <${wd}/uryuomoco | diff - ${wd}/english && +${wd}/english2uryuomoco <${wd}/english | diff - ${wd}/uryuomoco + diff --git a/uryuomoco b/uryuomoco new file mode 100644 index 0000000..d59b0a4 --- /dev/null +++ b/uryuomoco @@ -0,0 +1,13 @@ +uryuomoco +lespuko +tam +meh, meg chug! +seumto vusp gonkelulyuri quoyuro acot cho locgleen! +roulm u rumtauto chug… hucg??? +sago +roaisol seyunolu +tulougol seyunolu +yug yuc gyuno hel cho omja eh num +chyuc nucgol eh hyulo usura yumfolyug cho oulch +ni boli klocomso ougis uquuyu ug ieal hrous! + diff --git a/uryuomoco.zip b/uryuomoco.zip Binary files differnew file mode 100644 index 0000000..b513dcf --- /dev/null +++ b/uryuomoco.zip diff --git a/uryuomoco2english.c b/uryuomoco2english.c new file mode 100644 index 0000000..c373bc0 --- /dev/null +++ b/uryuomoco2english.c @@ -0,0 +1,157 @@ +#include <stdio.h> +#include <ctype.h> + +// uryuomoco to english +// abcdefghijklmnopqrstuvwxyz +char trl[]="uvsjohtfydprnmekwlcgabqzix"; + +/* + * a->u + * ais->ss + * b->v + * c->s + * ch->th + * d->j + * e->o + * f->h + * g->t + * gis->ts + * h->f + * i->y + * ja->d + * k->p + * l->r + * m->n + * n->m + * o->e + * ot ->ing + * p->k + * qu->w + * quo->wh + * r->l + * ra->ll + * s->c + * se->ch + * t->g + * tul->gr + * u->a + * us->sh + * v->b + * w->qu + * x->z + * y->i + * z->x + */ + +int tr(int c){ + int retval; + static int prev=0; + static int prevprev=0; + if(islower(c)){ + switch(c){ + case 'a': + if(prev=='j') break; // ja->d + else if(prev=='r') retval=putchar('l'); // ra->ll + else{ // ais->ss, a->u, + c=getchar(); + if(c=='i'){ // ai + c=getchar(); + if(c=='s'){ // ais + putchar('s'); + retval=putchar('s'); + break; + }else{ // ai? + putchar('u'); + retval=putchar('y'); + } + }else{ // a? + retval=putchar('u'); + } + return tr(c); + } + break; + case 'c': + c=getchar(); + if(c=='h'){ // ch->th + putchar('t'); + retval=putchar('h'); + }else{ // c->s + putchar('s'); + return tr(c); + } + break; + case 'e': retval=putchar(prev=='s'?'h':'o'); break; // se->ch, s->c + case 'h': retval=(prevprev=='m'&&prev=='e'?'f':putchar('f')); break; // meh -> no , h->f + case 'i': + if(prev=='g'){ // gi + c=getchar(); + if(c=='s'){ // gis -> ts + retval=putchar('s'); + }else{ // gi? + putchar('y'); // i->y + return tr(c); + } + }else retval=putchar('y'); // i->y + break; + case 'o': + if(prevprev=='q'&&prev=='u') retval=putchar('h'); // quo->wh + else{ + c=getchar(); + if(c=='t'){ // ot + c=getchar(); + if(!islower(c)){ // -ot -> -ing + putchar('i'); + putchar('n'); + putchar('g'); + retval=putchar(c); + }else{ // ot? + putchar('e'); + putchar('g'); + prev='t'; + return(tr(c)); + } + }else{ + putchar('e'); // o->e + prev='o'; + return(tr(c)); + } + } + break; + case 'u': if(prev=='q') break; // qu->w + else if(prev=='y') break; // yu->i + c=getchar(); + if(prev=='t'){ // tu + if(c=='l'){ // tul->gr + retval=putchar('r'); + }else{ // tu? + putchar('a'); + prev='u'; + return tr(c); + } + }else{ // u + if(!islower(prev)&&c=='s'){ // us-> sh + putchar('s'); + retval=putchar('h'); + }else{ // u->a + putchar('a'); + prev='u'; + return tr(c); + } + } + break; + case 'w': putchar('q'); retval=putchar('u'); break; // w -> qu + default: retval=putchar(trl[c-'a']); // single to single + } + }else retval=putchar(c); + prevprev=prev; + prev=c; + return retval; +} + +int main(int argc, char** argv){ + char c; + do{ + c=getchar(); + }while(c!=EOF && tr(c)!=EOF); + return 0; +} |