| 1 | %{ |
| 2 | /* |
| 3 | * Lex filter to transform plain English into Jive English. |
| 4 | * No racial or societal slurs are intended. For amusement only. |
| 5 | * |
| 6 | * Copyright 1986 by Daniel Klein and Clement Cole. |
| 7 | * |
| 8 | * Reproduction permitted so long as this notice is retained. |
| 9 | */ |
| 10 | %} |
| 11 | %e 1700 |
| 12 | %p 4000 |
| 13 | %n 700 |
| 14 | %k 450 |
| 15 | %a 1700 |
| 16 | %o 1500 |
| 17 | BW [ \t\(] |
| 18 | EW [ \t.,;!\?$\)] |
| 19 | %% |
| 20 | @[Bb]egin(.*) | |
| 21 | ".so ".*$ printf("%s", yytext); |
| 22 | {BW}send printf("%ct'row",yytext[0]); |
| 23 | program+ printf("honky code"); |
| 24 | [Uu]nix printf("slow mo-fo"); |
| 25 | UNIX printf("dat slow mo-fo"); |
| 26 | actual printf("ak'shul"); |
| 27 | {BW}take printf("%csnatch",yytext[0]); |
| 28 | {BW}took | |
| 29 | {BW}take[ns] printf("%csnatch'd",yytext[0]); |
| 30 | [Mm]exican printf("%cet-back", caseify('w')); |
| 31 | [Ii]talian printf("%creaser", caseify('g')); |
| 32 | {BW}big{EW} { printf("%cbig ass",yytext[0]);plastc();} |
| 33 | fool printf("honkyfool"); |
| 34 | modem printf("doodad"); |
| 35 | {BW}he{EW} { printf("%cmah' man he",yytext[0]);plastc();} |
| 36 | "e the"{EW} | |
| 37 | "a the"{EW} | |
| 38 | "t the"{EW} | |
| 39 | "d the"{EW} { printf("%c da damn", yytext[0]);plastc();} |
| 40 | wife | |
| 41 | woman printf("mama"); |
| 42 | girl printf("goat"); |
| 43 | something printf("sump'n"); |
| 44 | {BW}lie printf("%chonky jive",yytext[0]); |
| 45 | -o- printf("-on rebound-"); |
| 46 | [a-z]"." { printf("%s", yytext);expletive();} |
| 47 | ! printf(". Right On!"); |
| 48 | [Ss]ure printf("%cho'", yytext[0]); |
| 49 | get printf("git"); |
| 50 | "will have"{EW} | |
| 51 | "will"{EW} | |
| 52 | "got to"{EW} { printf("gots'ta");plastc();} |
| 53 | "I am" printf("I's gots'ta be"); |
| 54 | "aren't" | |
| 55 | "am not" | |
| 56 | "have not" | |
| 57 | "is not" | |
| 58 | "are not" printf("ain't"); |
| 59 | {BW}see{EW} { printf("%csee's",yytext[0]);plastc();} |
| 60 | {BW}are{EW} { printf("%cis",yytext[0]);plastc();} |
| 61 | {BW}hat{EW} { printf("%cfedora",yytext[0]);plastc();} |
| 62 | {BW}shoe printf("%ckicker",yytext[0]); |
| 63 | {BW}"have to"{EW} | |
| 64 | {BW}has{EW} { printf("%cgots'ta",yytext[0]);plastc();} |
| 65 | have printf("gots'"); |
| 66 | {BW}go{EW} | |
| 67 | {BW}"come over"{EW} | |
| 68 | {BW}come{EW} { printf("%cmosey on down",yytext[0]);plastc();} |
| 69 | buy printf("steal"); |
| 70 | {BW}car{EW} { printf("%cwheels",yytext[0]);plastc();} |
| 71 | drive printf("roll"); |
| 72 | {BW}food printf("%ccatfish an' colluhd greens",yytext[0]); |
| 73 | {BW}eat{EW} { printf("%cfeed da bud",yytext[0]);plastc();} |
| 74 | drink printf("guzzle"); |
| 75 | black | |
| 76 | negro printf("brother"); |
| 77 | white printf("honky"); |
| 78 | nigger printf("gentleman"); |
| 79 | nice printf("supa' fine"); |
| 80 | {BW}person printf("%csucka'",yytext[0]); |
| 81 | [Pp]eople printf("%cucka's", caseify('s')); |
| 82 | {BW}thing thing(yytext[0]); |
| 83 | house{EW} { printf("crib");plastc();} |
| 84 | home printf("plantation"); |
| 85 | name printf("dojigger"); |
| 86 | {BW}path printf("%calley",yytext[0]); |
| 87 | [Cc]omputer printf("%clunker", yytext[0]); |
| 88 | or printf("o'"); |
| 89 | president printf("super-dude"); |
| 90 | "prime minister" printf("prahm mistah"); |
| 91 | government printf("guv'ment"); |
| 92 | knew printf("knowed"); |
| 93 | [Bb]ecause printf("'%cuz", caseify('c')); |
| 94 | [Yy]our printf("%co'", yytext[0]); |
| 95 | [Ff]our printf("%coe", yytext[0]); |
| 96 | got printf("gots"); |
| 97 | young printf("yung"); |
| 98 | you printf("ya'"); |
| 99 | You printf("You's"); |
| 100 | first printf("fust"); |
| 101 | police printf("honky pigs"); |
| 102 | {BW}string printf("%cchittlin'",yytext[0]); |
| 103 | {BW}read printf("%ceyeball",yytext[0]); |
| 104 | write printf("scribble"); |
| 105 | think{EW} { printf("thin'");plastc();} |
| 106 | with printf("wif"); |
| 107 | other printf("uthu'"); |
| 108 | [Tt]hr printf("%c'r", yytext[0]); |
| 109 | [Tt]h printf("%c", caseify('d')); |
| 110 | ing printf("in'"); |
| 111 | {BW}a{EW} { printf("%csome",yytext[0]);plastc();} |
| 112 | {BW}to{EW} { printf("%ct'",yytext[0]); |
| 113 | if(yytext[yyleng-1]!=' ') |
| 114 | plastc(); |
| 115 | } |
| 116 | tion printf("shun"); |
| 117 | [Aa]lmost printf("%cos'", caseify('m')); |
| 118 | from printf("fum"); |
| 119 | [Yy]"ou're" printf("%couse", yytext[0]); |
| 120 | alright | |
| 121 | okay printf("coo'"); |
| 122 | [Aa]nd printf("%cn'", yytext[0]); |
| 123 | known printf("knode"); |
| 124 | want printf("wants'"); |
| 125 | beat printf("whup'ed"); |
| 126 | ile printf("ah'l"); |
| 127 | er{EW} { printf("uh");plastc();} |
| 128 | [a-z]sti printf("%cs'i", yytext[0]); |
| 129 | tute printf("toot"); |
| 130 | exp printf("'sp"); |
| 131 | exs | |
| 132 | exc printf("'s"); |
| 133 | {BW}ex printf("%c'es",yytext[0]); |
| 134 | [ae]ct{EW} { printf("%cc'", yytext[0]); plastc(); } |
| 135 | like printf("likes"); |
| 136 | done | |
| 137 | did printf("dun did"); |
| 138 | "kind of" printf("kind'a"); |
| 139 | women printf("honky chicks"); |
| 140 | {BW}man{EW} { printf("%cdude",yytext[0]);plastc();} |
| 141 | {BW}men{EW} | |
| 142 | {BW}mens{EW} { printf("%cdudes",yytext[0]);plastc();} |
| 143 | injured printf("hosed"); |
| 144 | killed | |
| 145 | dead printf("wasted"); |
| 146 | good printf("baaaad"); |
| 147 | open{EW} { printf("jimmey");plastc();} |
| 148 | opened{EW} { printf("jimmey'd");plastc();} |
| 149 | {BW}very printf("%creal",yytext[0]); |
| 150 | per printf("puh'"); |
| 151 | oar printf("o'"); |
| 152 | {BW}can printf("%ckin",yytext[0]); |
| 153 | {BW}just{EW} { printf("%cplum",yytext[0]);plastc();} |
| 154 | [Dd]etroit printf("Mo-town"); |
| 155 | [Ww]"estern "[Ee]"lectric" printf("da' cave"); |
| 156 | {BW}believe printf("%crecon'",yytext[0]); |
| 157 | [Ii]"ndianapolis" printf("Nap-town"); |
| 158 | Daniel | |
| 159 | Dan printf("Liva' Lips"); |
| 160 | Reagan printf("Kingfish"); |
| 161 | Ronald{EW} | |
| 162 | Ron{EW} { printf("Rolo");plastc();} |
| 163 | John printf("Rastus"); |
| 164 | Jim printf("Bo-Jangles"); |
| 165 | pontiff | |
| 166 | pope printf("wiz'"); |
| 167 | [Pp]ravda printf("dat commie rag"); |
| 168 | broken printf("bugger'd"); |
| 169 | strange{EW} { printf("funky");plastc();} |
| 170 | dance{EW} { printf("boogy");plastc();} |
| 171 | ask printf("ax'"); |
| 172 | {BW}so{EW} { printf("%cso's",yytext[0]);plastc();} |
| 173 | heard printf("'hoid"); |
| 174 | head printf("'haid"); |
| 175 | boss printf("main man"); |
| 176 | money printf("bre'd"); |
| 177 | [a-z]":" { *(yytext+1) = ','; |
| 178 | printf("%s dig dis:",yytext); |
| 179 | } |
| 180 | amateur printf("begina'"); |
| 181 | radio printf("transista'"); |
| 182 | {BW}of{EW} { printf("%cuh",yytext[0]);plastc();} |
| 183 | which | |
| 184 | what printf("whut"); |
| 185 | "don't" printf("doan'"); |
| 186 | does printf("duz"); |
| 187 | {BW}was{EW} | |
| 188 | {BW}were{EW} { printf("%cwuz",yytext[0]);plastc();} |
| 189 | {BW}understand printf("%cdig",yytext[0]); |
| 190 | {BW}my printf("%cmah'",yytext[0]); |
| 191 | again | |
| 192 | against printf("agin'"); |
| 193 | {BW}[Ii]{EW} { printf("%cah'",yytext[0]);plastc();} |
| 194 | meta printf("meta-fuckin'"); |
| 195 | cally printf("c'l"); |
| 196 | %% |
| 197 | plastc() |
| 198 | { |
| 199 | unput(yytext[yyleng-1]); |
| 200 | } |
| 201 | |
| 202 | caseify(c) |
| 203 | char c; |
| 204 | { |
| 205 | if (yytext[0] <= 'Z') |
| 206 | return (c - ' '); |
| 207 | else |
| 208 | return (c); |
| 209 | } |
| 210 | |
| 211 | thing(c) |
| 212 | char c; |
| 213 | { |
| 214 | static short count = 0; |
| 215 | |
| 216 | putchar(c); |
| 217 | switch (count++ % 4) { |
| 218 | case 0: case 2: |
| 219 | printf("thang"); |
| 220 | break; |
| 221 | case 1: |
| 222 | printf("doohickey"); |
| 223 | break; |
| 224 | case 3: |
| 225 | printf("wahtahmellun"); |
| 226 | break; |
| 227 | } |
| 228 | } |
| 229 | expletive() |
| 230 | { |
| 231 | static short count = 0; |
| 232 | static short which = 0; |
| 233 | |
| 234 | if (count++ % 4 == 0) { |
| 235 | switch (which++ % 5) { |
| 236 | case 0: printf(" What it is, Mama!"); break; |
| 237 | case 1: printf(" Ya' know?"); break; |
| 238 | case 2: printf(" Sheeeiit."); break; |
| 239 | case 3: printf(" Ya' dig?"); break; |
| 240 | case 4: printf(" Git down!"); break; |
| 241 | } |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | /* |
| 246 | * Bugs: |
| 247 | * |
| 248 | * If a sentence starts with a keyword it doan' get converted, or: |
| 249 | * it do, but gets a leading space |
| 250 | */ |