Skip to content

Instantly share code, notes, and snippets.

@theterg
Created December 27, 2011 20:00
Show Gist options
  • Save theterg/1524970 to your computer and use it in GitHub Desktop.
Save theterg/1524970 to your computer and use it in GitHub Desktop.
MA translator plugin for chef
static int i_seen = 0;
%}
WC [A-Za-z']
NW [^A-Za-z']
%start INW NIW
%%
\\[^ \n]+ ECHO;
[.!?]$ { BEGIN NIW; i_seen = 0;
printf("%c!?!",yytext[0]); }
"Bu" { BEGIN INW; printf("Bah"); }
"bu" { BEGIN INW; printf("bah"); }
"Di" { BEGIN INW; printf("Dee"); }
"di" { BEGIN INW; printf("dee"); }
"De" { BEGIN INW; printf("Dee"); }
"de" { BEGIN INW; printf("dee"); }
"Mo" { BEGIN INW; printf("Moah"); }
"mo" { BEGIN INW; printf("moah"); }
"sp" { BEGIN INW; printf("spa"); }
"c" { BEGIN INW; printf("sh"); }
. { BEGIN INW; ECHO; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment