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