* censor: corrected spelling of pyvgbevf, Closes: #172976
[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 */
10%}
11%e 1700
12%p 4000
13%n 700
14%k 450
15%a 1700
16%o 1500
17BW [ \t\(]
18EW [ \t.,;!\?$\)]
19%%
20@[Bb]egin(.*) |
21".so ".*$ printf("%s", yytext);
22{BW}send printf("%ct'row",yytext[0]);
23program+ printf("honky code");
24[Uu]nix printf("slow mo-fo");
25UNIX printf("dat slow mo-fo");
26actual 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();}
33fool printf("honkyfool");
34modem 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();}
40wife |
41woman printf("mama");
42girl printf("goat");
43something 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]);
49get 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();}
65have printf("gots'");
66{BW}go{EW} |
67{BW}"come over"{EW} |
68{BW}come{EW} { printf("%cmosey on down",yytext[0]);plastc();}
69buy printf("steal");
70{BW}car{EW} { printf("%cwheels",yytext[0]);plastc();}
71drive printf("roll");
72{BW}food printf("%ccatfish an' colluhd greens",yytext[0]);
73{BW}eat{EW} { printf("%cfeed da bud",yytext[0]);plastc();}
74drink printf("guzzle");
75black |
76negro printf("brother");
77white printf("honky");
78nigger printf("gentleman");
79nice printf("supa' fine");
80{BW}person printf("%csucka'",yytext[0]);
81[Pp]eople printf("%cucka's", caseify('s'));
82{BW}thing thing(yytext[0]);
83house{EW} { printf("crib");plastc();}
84home printf("plantation");
85name printf("dojigger");
86{BW}path printf("%calley",yytext[0]);
87[Cc]omputer printf("%clunker", yytext[0]);
88or printf("o'");
89president printf("super-dude");
90"prime minister" printf("prahm mistah");
91government printf("guv'ment");
92knew printf("knowed");
93[Bb]ecause printf("'%cuz", caseify('c'));
94[Yy]our printf("%co'", yytext[0]);
95[Ff]our printf("%coe", yytext[0]);
96got printf("gots");
97young printf("yung");
98you printf("ya'");
99You printf("You's");
100first printf("fust");
101police printf("honky pigs");
102{BW}string printf("%cchittlin'",yytext[0]);
103{BW}read printf("%ceyeball",yytext[0]);
104write printf("scribble");
105think{EW} { printf("thin'");plastc();}
106with printf("wif");
107other printf("uthu'");
108[Tt]hr printf("%c'r", yytext[0]);
109[Tt]h printf("%c", caseify('d'));
110ing 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 }
116tion printf("shun");
117[Aa]lmost printf("%cos'", caseify('m'));
118from printf("fum");
119[Yy]"ou're" printf("%couse", yytext[0]);
120alright |
121okay printf("coo'");
122[Aa]nd printf("%cn'", yytext[0]);
123known printf("knode");
124want printf("wants'");
125beat printf("whup'ed");
126ile printf("ah'l");
127er{EW} { printf("uh");plastc();}
128[a-z]sti printf("%cs'i", yytext[0]);
129tute printf("toot");
130exp printf("'sp");
131exs |
132exc printf("'s");
133{BW}ex printf("%c'es",yytext[0]);
134[ae]ct{EW} { printf("%cc'", yytext[0]); plastc(); }
135like printf("likes");
136done |
137did printf("dun did");
138"kind of" printf("kind'a");
139women 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();}
143injured printf("hosed");
144killed |
145dead printf("wasted");
146good printf("baaaad");
147open{EW} { printf("jimmey");plastc();}
148opened{EW} { printf("jimmey'd");plastc();}
149{BW}very printf("%creal",yytext[0]);
150per printf("puh'");
151oar 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");
158Daniel |
159Dan printf("Liva' Lips");
160Reagan printf("Kingfish");
161Ronald{EW} |
162Ron{EW} { printf("Rolo");plastc();}
163John printf("Rastus");
164Jim printf("Bo-Jangles");
165pontiff |
166pope printf("wiz'");
167[Pp]ravda printf("dat commie rag");
168broken printf("bugger'd");
169strange{EW} { printf("funky");plastc();}
170dance{EW} { printf("boogy");plastc();}
171ask printf("ax'");
172{BW}so{EW} { printf("%cso's",yytext[0]);plastc();}
173heard printf("'hoid");
174head printf("'haid");
175boss printf("main man");
176money printf("bre'd");
177[a-z]":" { *(yytext+1) = ',';
178 printf("%s dig dis:",yytext);
179 }
180amateur printf("begina'");
181radio printf("transista'");
182{BW}of{EW} { printf("%cuh",yytext[0]);plastc();}
183which |
184what printf("whut");
185"don't" printf("doan'");
186does 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]);
191again |
192against printf("agin'");
193{BW}[Ii]{EW} { printf("%cah'",yytext[0]);plastc();}
194meta printf("meta-fuckin'");
195cally printf("c'l");
196%%
197plastc()
198{
199 unput(yytext[yyleng-1]);
200}
201
202caseify(c)
203char c;
204{
205 if (yytext[0] <= 'Z')
206 return (c - ' ');
207 else
208 return (c);
209}
210
211thing(c)
212char 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}
229expletive()
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 */
This page took 0.022542 seconds and 4 git commands to generate.