From: joey Date: Sat, 11 Sep 1999 04:25:01 +0000 (+0000) Subject: Initial revision X-Git-Tag: 2.39~52 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=7e3afbbacdd24f8c3fb87599eeda32b977fe6d6c;p=filters.git Initial revision --- 7e3afbbacdd24f8c3fb87599eeda32b977fe6d6c diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7600f97 --- /dev/null +++ b/Makefile @@ -0,0 +1,39 @@ +# Various dialect translators. + +LEX = flex + +ALL = jive valspeak nyc cockney fin biffa ken aust drawl \ + kraut newspeak chef mb censor fudd moo buck \ + jethro b1ff +OTHER = ky00te + +all: $(OTHER) $(ALL) + +install: $(ALL) $(OTHER) + install -d $(PREFIX)/usr/games + install -s $(ALL) $(OTHER) $(PREFIX)/usr/games/ + install -d $(PREFIX)/usr/man/man6 + install -m 0644 filters.6 $(PREFIX)/usr/man/man6 + cd $(PREFIX)/usr/man/man6 && \ + $(foreach prog,$(ALL) $(OTHER),ln -s filters.6 $(prog).6;) + +samples: $(ALL) $(OTHER) + echo $(ALL) $(OTHER) |xargs -n 1 sh makesample.sh + +clean: + $(RM) -f core *.o *~ $(ALL) *.c SAMPLES + cd ky00te.dir; make clean + +.SUFFIXES: .l + +.l: + $(RM) $*.c + $(LEX) -t $< > $*.c + $(CC) -O -o $@ $*.c -lfl -g +# strip $@ + $(RM) $*.c + +.SUFFIXES: .dir + +.dir: + cd $<; make diff --git a/README b/README new file mode 100644 index 0000000..f5a71ad --- /dev/null +++ b/README @@ -0,0 +1,39 @@ +This is a collection of filters from various places, including: + +http://www.princeton.edu/~mkporwit/pub_links/davido/slang/ + +http://www.mathlab.sunysb.edu/~elijah/src.html + +Collected by Joey Hess + + +Note that the Makefile will get the filters to compile on Linux systems. +Otherwise, you're on your own. + + +Descriptions of the filters: + +aust: Australian +b1ff: The B1FF filter +biffa: ?? +buck: The buckwheat filter +censor: [CENSORED] +chef: convert English on stdin to Mock Swedish on stdout +cockney: Cockney English +drawl: English to Texan translator +fin: ?? +fudd: Elmer Fudd +jethro: Hillbilly text filter +jive: Jive English +ken: English into Cockney, featuring (dubious) rhyming + slang for a lot of computer terminology. +kraut: German +mb: Marc Barrett posting translator +moo: The cow filter +newspeak: As in 1984 +nyc: Brooklyn English +valspeak: ?? +ky00te: This program places a very cute (and familiar to FurryMuck + fans) accent to any text file. + +No racial or societal slurs are intended. For amusement only. diff --git a/aust.l b/aust.l new file mode 100644 index 0000000..39313ae --- /dev/null +++ b/aust.l @@ -0,0 +1,171 @@ +%e 3000 +%p 8000 +%n 2000 +%k 2000 +%a 3000 +%o 2000 +BW [ ] +EW [ .,:;!?_] +ES [.:;!?] +VO [aeiouy] +CO [bcdfghjklmnpqrstvwxz] +CC [cdfgjklmnprtz] +SC [cg] +HC [bdfhjklmnpqrstvwxz] +ST [pbtdkg] +LE [a-zA-Z] + +%{ + + /* English to australian translator */ + + /* to build with standard at&t lex + * lex aust.l + * cc lex.yy.c -ll -o aust + * + * to build with flex + * flex -I aust.l + * cc lex.yy.c -o aust + * + * (flex is a pd version of lex that runs under Unix, VMS and MSDOS.) + */ + + /* 16Jan90 - wb - first version, based on biffa.l by + * Stephen K Mulrine */ + /* 30Jan90 - wb - added more words */ + /* 16Feb90 - wb - converted from jive to aust */ + /* 12Mar90 - wb - added some randomness */ + + + /* BW = begin word */ + /* EW = end word */ + /* ES = end sentence */ + /* VO = vowel */ + /* CO = consonant */ + /* CC = end of consonant cluster */ + /* SC = soft consonant (need an 'e') */ + /* HC = hard consonant (does not need an 'e') */ + /* ST = stop */ + /* LE = any letter */ + +bloody(n) +int n; +{ + if (n == 0 || rand() < n) + printf((rand() < 20000)? "bloody ": "bleedin' "); +} + +say(msg, n) +char *msg; +int n; +{ + if (rand() < n) + printf("%s", msg); +} + +oi(n) +int n; +{ + say(" Blimey!", n); + while (rand() < n) + printf(" OI!"); +} + + +%} + +%% +"That is" | +"That's" printf("Thaz"); +"that is" | +"that's" printf("thaz"); +bathroom | +toilet printf("loo"); +{BW}john{EW} printf("%cloo%c", yytext[0], yytext[5]); +[Aa]lright printf("%clrighty", yytext[0]); +{BW}mad{EW} printf("%cpissed%c", yytext[0], yytext[4]); +angry | +annoyed printf("pissed"); +drunk printf("loaded"); +drank printf("swilled"); +drink printf("swill"); +{BW}beer printf("%cFoster's", yytext[0]); /* Australian for beer, mate */ +"ught to" printf("ughta"); +{BW}train printf("%cland train", yytext[0]); +ough{EW} printf("o%c", yytext[4]); +Hello{EW} | +"Good day"{EW} printf("G'day!"); +hello{EW} | +"good day"{EW} printf("g'day!"); +"in Austrailia" | +"to Austrailia" printf("down under"); +{BW}bit{EW} printf("%ctad%c", yytext[0], yytext[4]); + +{CO}{CC}{EW} printf("%c'%c", yytext[0], yytext[2]); +{CO}{CC}ed{EW} printf("%c%s", yytext[0], yytext+2); +of{EW} printf("o'%c", yytext[2]); + +Some{BW}one | +Someone | +Guy printf("Dude"); +some{BW}one | +someone | +guy printf("dude"); + +[Ww]ha printf("%co", yytext[0]); +{BW}esp printf("'sp"); +{BW}Esp printf("'Sp"); + +{BW}h{LE} printf("%c'%c", yytext[0], yytext[2]); +off{BW}of printf("offa"); + +[Yy]our printf("%cer", yytext[0]); +you{EW} printf("ya%c", yytext[3]); +my printf("me"); + +{CO}[ai]{SC}e printf("%coi%ce", yytext[0], yytext[2]); +{CO}[ai]{HC}e printf("%coi%c", yytext[0], yytext[2]); +{CO}[ai]{CO}[aiouy] printf("%coi%c%c", yytext[0], yytext[2], yytext[3]); +r[ai]{CO}{CO} printf("%coi%c%c", yytext[0], yytext[2], yytext[3]); +{CO}igh{LE} printf("%coi%c", yytext[0], yytext[4]); +extremely | +really | +very printf("roit"); +Extremely | +Really | +Very printf("Roit"); +that printf("wot"); +Well printf("Welp"); +baseball | +football | +hockey printf("cricket"); +{VO}th({EW}|{VO}) printf("%ct%c", yytext[0], yytext[3]); +Who printf("Oo"); +{BW}who printf("%c'oo", yytext[0]); +{LE}{CO}er{EW} printf("%c%ca%c", yytext[0], yytext[1], yytext[4]); +{VO}{CO}e{BW}to printf("%c%ceda", yytext[0], yytext[1]); +{VO}{CO}{BW}to printf("%c%c%ca", yytext[0], yytext[1], yytext[1]); +{BW}[Bb]e{CO}{LE} printf("%c'%s", yytext[0], yytext+3); +{BW}[Aa]{CO}{LE} printf("%c'%s", yytext[0], yytext+2); +{BW}[Oo]ne? printf("%c'un", yytext[0]); + +{LE}\, {ECHO; say(" moit,", 10000);} +{BW}an?{EW} {if(rand()<12000){printf(" a ");bloody(0);}else printf("%s",yytext);} +An?{EW} {if(rand()<12000){printf("A ");bloody(0);}else printf("%s",yytext);} +(T|({BW}t))he{EW} | +(T|({BW}t))hose{EW} {ECHO; bloody(12000);} + +\!|\? {say(", moit", 6000); ECHO; oi(12000);} +\. {say(", moit", 2000); ECHO; oi(6000);} + +{BW}-*[0-9]+" "*("degrees"|([Ff]{LE}*)){EW} {printf("%c%dc%c",*yytext,((atoi(yytext+1)-24)/9)*5,yytext[strlen(yytext)-1]);} + +. printf("%s", yytext); +\n printf("\n"); + +%% +main() +{ + yylex(); +} + diff --git a/b1ff b/b1ff new file mode 100755 index 0000000..f958c0f --- /dev/null +++ b/b1ff @@ -0,0 +1,117 @@ +#!/usr/bin/perl -p +# B1FF filter. +# Copyright 1999 by Joey Hess under the terms of the GNU GPL. + +# I use an array, not a hash. because order is important. +@trans_table=( + '\bEVERYONE\b' => 'EVRY 1', + '\bEVERYBODY\b' => 'EVRY BUDY', + '\bEVERY\b' => 'EVRY', + '\bONE\b' => '1', + '\bAND\b' => '+', + '\bYOU' => 'U', + '\bITS\b' => 'IT"S', + '\bIT\'S\b' => 'ITS', + '\bIS\b' => 'IZ', + '\bLINUX\b' => 'LINUS', + '\bUNIX\b' => 'THE MANEFRA1M O/S', + '\bWINDOWS\b' => 'WINDOWZ (IT RULEZ MAN!)', + '\bYOU\'RE\b' => 'YOUR', + '\bTHEM\b' => 'THUM', + '\bHERE\b' => 'HERE', + '\bTHEY\'RE\b' => 'THE1R', + '\bTHEIR\b' => 'THERE', + '\bWAS\b' => 'WUZ', + '\bMACINTOSH\b' => 'IMAC', # too 90's? + '\bVERY\b' => 'TOTALLY', + '\bCOMPUTER\b' => 'VIC-20', + '\bWHETHER\b' => 'WHETHUR', + '\b(?:H|CR)ACKER\b' => 'KEWL HACKER D00D!', + '\bOF\b' => 'UV', + '\bGNU\b' => 'NEW', + '\bQUITE\b' => 'REAL', + '\bFREE\b' => 'FREE!', + + 'HOME' => 'HUM', + 'COME' => 'CUM', + 'MICRO' => 'MIKRO', + 'GOVERN' => 'GUVERN', + 'PERSON' => 'D00D', + 'SOME' => 'SUM', + 'WRITE' => 'RITE', + 'REAL' => 'REEL', + 'LITE' => 'L1TE', + 'BIAN' => 'B1AN', + 'TION' => 'SHUN', + 'FOR' => '4', + 'TO' => '2', + 'ATE' => '8', + '\b2TALLY\b' => 'TOTALY', # fix from line above + 'LL' => 'L', + 'OO' => '00', + 'MATE' => 'M8', + 'ER' => 'UR', + 'S+\b' => 'Z', + 'KN' => 'N', +); + +$_=uc; +s/;/,/g; +s/'//g; + +while (@trans_table) { + $key=shift @trans_table; + $value=shift @trans_table; + s/$key/$value/g; +} + +s/(\!+)/$1.make_exclimation()/eg; +s/(\?+)/$1.make_question()/eg; +s/I/rand 3 > 2 ? '1' : 'I'/eg; # change 1/3 of I's to 1's + +@punct=('.','!',','); + +s/\. /. /g; +s/\./$punct[int(rand 3)]/eg; +s/\,/./g; + + +# b1ff can't hold down on shift too well!!!!!!!1! +sub make_exclimation { + my $length=shift || int(rand 5); + my $ret='!'; + my $last=0; + for (1..$length) { + if (! $last && int(rand 3) eq 2) { + $ret.="1"; + $last=1; + } + else { + $ret.="!"; + $last=0; + } + } + return $ret; +} + +# ask questions excitedly?!?!?!?! +sub make_question { + my $length=shift || int(rand 5) + 1; + my $ret=''; + my $last=0; + while (length($ret) < $length) { + if (! $last && int(rand 5) > 2) { + $ret.="?!"; + $last=1; + } + elsif (! $last && int(rand 5) > 3) { + $ret.="?1"; + $last=1; + } + else { + $ret.="?"; + $last=0; + } + } + return $ret; +} diff --git a/b1ff.l b/b1ff.l new file mode 100644 index 0000000..40637b6 --- /dev/null +++ b/b1ff.l @@ -0,0 +1,302 @@ + +%e 2000 +%p 5000 +%n 1000 +%k 500 +%a 4000 +%o 2000 +BW [ ] +EW [ .,;!?] + +%{ + +/* + * The B1FF filter. + * + * Modification History + * + * - Created Sat Feb 26 04:02:01 EST 1994 by Dave Baggett , + * who obviously had too much time on his hands. Based on the earlier + * "jive" filter of unknown origin. + * + * ------------------------------------------------------------------------- + * To build the B1FF filter, do the following: + * + * lex biff.l + * cc -o biff lex.yy.c -ll + * rm lex.yy.c + * + * Optionally replace lex and cc above with flex and gcc. + * + * To use the executable, pipe stuff to it; e.g., + * + * cat foo | biff + * + */ + +char buf[128]; +int count = 0; +char WhAt[]="@(#)DAVE BAGGETT-S B1FF!!1 FlLTER + A CHANGE OR 2 BYE BGRIFFIN\n@(#)$Header: b1ff.l,v 1.4 94/05/07 20:42:53 bgriffin Final $"; + +%} + +%% + +" and " printf(" + "); +" plus " printf(" + "); +"you're" printf("YOUR"); +your printf("UR"); +"it's" printf("1TZ"); +its printf("1T'Z"); +here printf("HEAR"); +hear printf("HERE"); +"they're" printf("THE1R"); +their printf("THERE"); +there printf("THEY'RE"); +was printf("WUZ"); +etc printf("U GET THE 1DEA"); +e[.]g[.] printf("LAIK THIS"); +i[.]e[.] printf("U NOE LAIK"); +" are " printf(" R "); +"be " printf("B "); +before printf("B4"); +" to " printf(" 2 "); +this printf("TH1S"); +like printf("LA1K"); +total printf("TODAL"); +"and I" printf("+ ME"); + +good printf("K00L"); +okay printf("C00L"); +ok printf("K00L"); +interesting printf("C00L"); +neat printf("Q00L"); +nifty printf("Q00L"); +useful printf("K00L"); +great printf("RAD"); +functional printf("RAD"); +excellent printf("X-L-ENT"); +very printf("TOTALLY"); +quite printf("REAL"); +really printf("REAL"); +new printf("NU"); +recent printf("RAD NU"); + +result printf("TH1NG"); +ramification printf("TH1NG"); +reason printf("TH1NG"); +conclusion printf("TH1NG"); +results printf("STUFF"); +ramifications printf("STUFF"); +reasons printf("STUFF"); +conclusions printf("STUFF"); + +files printf("WAREZ"); +program printf("GAME"); +programs printf("WAREZ"); +game printf("KRACKED GAME"); +games printf("GAMEZ"); +[Uu][Nn][Ii][Xx] printf("THE MANEFRA1M O/S"); +[Dd][Oo][Ss] printf("THE VIC-20 TAPE DRIVE SCR1PTER"); +disk printf("TAPE"); +computer printf("VIC-20"); +workstation printf("MANEFRA1M"); +supercomputer printf("MANEFRAM"); +[Cc]ray printf("K1CKASS MANEFRA1M"); +"Connection Machine" printf("TODALY RAD KOMPUTUR BRANE"); +machine printf("VIC-20"); +[Aa][Tt][Aa][Rr][Ii] printf("PEACE UV SH1T ATAR1"); +[Aa][Pp][Pp][Ll][Ee] printf("PEACE UV SH1T APPEL"); +[Aa][Mm][Ii][Gg][Aa] printf("WORKSTASHUN"); +[Mm]acintosh printf("MACK1NTRASH"); +upload printf("U/L"); +download printf("D/L"); +load printf("U/L"); +save printf("D/L"); +send printf("U/L"); +receive printf("D/L"); +ftp printf("XMODEM"); +buy printf("D-L"); + +[Pp]ascal printf("THAT WUSSY LANGUAGE"); +[Mm]odula.[23] printf("THAT WUSSY SH1T LANGUAGE"); +[Ll]isp printf("THAT KOMPUTUR BRANE LANGUAGE"); +[Ss]cheme printf("THAT TODAL NURD LANGUAGE"); +[Aa]da printf("THAT K00L NU ARMY LANGUAGE"); +[Pp]ost[Ss]cript printf("PRINTUR KODEZ"); +[Aa]ssembly printf("CPU KODE"); +[Aa]ssembler printf("CPU KODE"); + +newsgroup printf("MESSAGE BASE"); +news printf("MESSAGES"); +thread printf("BOARD"); +[Uu]senet printf("THE MANEFRAIM BOARDZ"); +[Nn]et[Nn]ews printf("THE BOARDZ"); + +fool printf("LUZER"); +moron printf("LAMER"); +idiot printf("LAMER"); +jerk printf("HOZER"); +dweeb printf("LUZER"); +geek printf("HOZER"); +nerd printf("LUZER"); + +" man " printf(" D00D "); +" men " printf(" D00DZ "); +woman printf("BABE"); +women printf("BABEZ"); +wife printf("BABE"); +husband printf("LOVERD00D"); +girlfriend printf("PEACE"); +boyfriend printf("STUD"); +girl printf("TODAL BABE"); +person printf("D00D"); +people printf("D00DZ"); +friend printf("FRE1ND"); + +sure printf("SHUR"); +"got to" printf("GOTTA"); +"want to" printf("WANNA"); +"have to" printf("HAFTA"); +have printf("GOT"); + +"using" printf("UZE1NG"); + +" car " printf(" WHEELS "); +" eat " printf(" NARF "); + +police printf("P1GZ"); +from printf("FRUM"); + +human printf("D00D"); +occasionally printf("SUMTIMZ"); +whom printf("WHO"); +whose printf("WHO'S"); +who's printf("WHOSE"); +"who is" printf("WHOSE"); +"ought to" printf("OTTA"); +"need to" printf("GOTTA"); +"should" printf("OTTA"); +"tonight" printf("2NITE"); +together printf("2GETHR"); +tomorrow printf("2MOROW"); +today printf("LAST NITE"); +to-day printf("2DAY"); +" food " printf(" PIZZA "); +coke printf("MOUNTIN DOO"); +pepsi printf("MOUNTIN DOO"); +caffeine printf("COKE"); +coffee printf("SPEED"); +[Nn]yquil printf("SMACK"); +night printf("NITE"); + +" believe" printf(" TH1NK"); +phone printf("FONE"); +freak printf("PHREAK"); +[Kk][Ii*-][Bb][Oo*-] printf("THE FONT GUY"); +[nN]et[htw][ar][cer][ke] { /* nethack nettrek netware */ + printf("PACMAN"); } +chess printf("PONG"); +[Ss]"treet "[Ff]ighter printf("POLL POSIT1ON"); + +amateur printf("LAMER"); +" of " printf(" UV "); +what printf("WUT"); +"meta " printf("ALT/CAPSLOCK "); + +"talk" printf("1NTERFACE"); +"sort of" printf("SORTA"); +"kind of" printf("K1NDA"); +magazine printf("ZINE"); + +":^)" ; +":-)" printf("HAHAHAHA!!1!1!1!!!1!!!"); +"8-)" printf("ITZA JOKE YA NOE"); + +[dgmnr]"." { *(yytext+1) = 0; + upcase(yytext); + sprintf(buf, "%s!",yytext); + printf(buf); + } + +[efhkpst]"." { *(yytext+1) = 0; + upcase(yytext); + sprintf(buf, "%s,",yytext); + printf(buf); + } + +[bclw]"." { *(yytext+1) = 0; + upcase(yytext); + sprintf(buf, "%s...",yytext); + printf(buf); + } + +[a-e]"?" { upcase(yytext); printf(yytext); printf("?"); } +[f-j]"?" { upcase(yytext); printf(yytext); printf("??"); } +[k-o]"?" { upcase(yytext); printf(yytext); printf("!?1?"); } +[p-t]"?" { upcase(yytext); printf(yytext); printf("!?1?!?"); } +[u-z]"?" { upcase(yytext); printf(yytext); printf("?1?!?1?!"); } +[a-e]"!" { upcase(yytext); printf(yytext); printf("!"); } +[f-j]"!" { upcase(yytext); printf(yytext); printf("!!"); } +[k-o]"!" { upcase(yytext); printf(yytext); printf("!1!"); } +[p-t]"!" { upcase(yytext); printf(yytext); printf("!!1!"); } +[u-z]"!" { upcase(yytext); printf(yytext); printf("!1!!1"); } +";" printf(","); +"," printf("."); +"'" ; +[a-z]":" { *(yytext+1) = ','; + upcase(yytext); + sprintf(buf, "%s L1KE:",yytext); + printf(buf); + } +[iI] { count++; if (count % 3 == 0) printf("1"); else printf("I"); } +oo printf("00"); +0 printf("o"); +"s " printf("Z "); +"s." printf("Z."); +cr printf("KR"); +wr printf("R"); +ate printf("8"); +ait printf("8"); +ame printf("A1M"); +ain printf("ANE"); +ade printf("AID"); +four printf("4"); +fore printf("4"); +for printf("4"); +see printf("C"); +seeing printf("CN"); +you printf("U"); +ude printf("00D"); +ule printf("OOL"); +ome printf("UM"); +ose printf("UZE"); +tion printf("SHUN"); +mn printf("M"); +kn printf("N"); +er printf("UR"); +em printf("UM"); +ll printf("L"); +ware printf("WEAR"); + +. { upcase(yytext); printf(yytext); } + +\n printf("\n"); + +%% + +upcase(s) + char *s; +{ + while (*s) { + if (islower(*s)) + *s = toupper(*s); + s++; + } +} + +main() +{ + yylex(); +} + diff --git a/biffa.l b/biffa.l new file mode 100644 index 0000000..e7dc80c --- /dev/null +++ b/biffa.l @@ -0,0 +1,265 @@ +%e 3000 +%p 6000 +%n 1000 +%k 500 +%a 4000 +%o 2000 +BW [ ] +EW [ .,;!?] + +%{ + char buf[128]; + +%} + +%% +ead printf("eed"); +ote printf("urte"); +oad printf("urd"); +ode printf("urde"); +oke printf("urke"); +olk printf("urk"); +one printf("urn"); +al printf("aal"); +OK printf("aal reyt"); +"O.K." printf("all reyt"); +okay printf("aal reyt"); +Okay printf("Aal reyt"); +mother printf("mutha"); +mummy printf("mutha"); +ma{EW} printf("mutha "); +father printf("fatha"); +dad printf("fatha"); +pa{EW} printf("fatha "); +telephone printf("furn"); +ph printf("f"); +and printf("un'"); +And printf("Un'"); +only printf("urnly"); +over printf("urva"); +will printf("'ll"); +"You are" printf("Y'a fuckin'"); +"you are" printf("y'a fuckin'"); +"I am" printf("A'm fuckin'"); +"I'm" printf("A'm fuckin'"); +Most printf("Murst"); +most printf("murst"); +murder printf("knack"); +shatter printf("knack"); +damage printf("knack"); +Murder printf("Knack"); +Shatter printf("Knack"); +Damage printf("Knack"); +"Oh yes?" printf("Did yee spill wor pint?"); +[Cc]hinese printf("Chinky"); +"no it isn't" printf("Is it shite"); +"No it is not" printf("Is it shite"); +"It is not" printf("Is it fuck"); +"it is not" printf("is it fuck"); +"It isn't" printf("Is it fuck"); +"it isn't" printf("is it fuck"); +idle printf("ardle"); +rubbish printf("gobshite"); +useless printf("shite"); +"no good" printf("shite"); +shit printf("shite"); +muck printf("shite"); +mouth printf("gob"); +Mouth printf("Gob"); +someone printf("some fukka"); +Someone printf("Some fukka"); +anyone printf("any fukka"); +Anyone printf("Any fukka"); +nobody printf("neewun"); +Nobody printf("Neewun"); +noone printf("neewun"); +Noone printf("Neewun"); +"who is" printf("who tha fuck's"); +"Who is" printf("Who tha fuck's"); +"who are" printf("who tha fuck'a'"); +"Who are" printf("Who tha fuck'a'"); +"Why is" printf("Why tha fuck's"); +"Why is" printf("Why tha fuck's"); +"why are" printf("why tha fuck'a'"); +"Why are" printf("Why tha fuck'a'"); +"when is" printf("when tha fuck's"); +"When is" printf("When tha fuck's"); +"when are" printf("when tha fuck'a'"); +"When are" printf("When tha fuck'a'"); +tough printf("fuckin' hard"); +strong printf("fuckin' hard"); +"! " printf(", ya fuckin' puff! "); +nothing printf("bugga aal"); +Nothing printf("Bugga aal"); +food printf("grub"); +Food printf("Grub"); +My printf("Ma fuckin'"); +Your printf("Y' fuckin'"); +Our printf("Wor fuckin'"); +throw printf("hoy"); +Throw printf("Hoy"); +lots printf("lurds"); +Lots printf("Lurds"); +" have" printf("'ve"); +Have printf("Hev"); +"don't" printf("divvn't"); +"Don't" printf("Divvn't"); +"isn't" printf("in't"); +"Isn't" printf("In't"); +."self " printf("ssel "); +girls printf("lasses"); +girl printf("lass"); +boy printf("lad"); +know printf("knaa"); +make printf("maak"); +take printf("tek"); +Take printf("Tek"); +tak printf("tek"); +th[eo]se printf("them"); +broken printf("brerken"); +Broken printf("Brerken"); +broke printf("brerk"); +" tired" printf(" fuckin' knackered"); +gives printf("giz"); +give printf("giz"); +Give printf("Giz"); +giv printf("gizz"); +gave printf("gav"); +TV printf("telly"); +[Ww]ill printf("'ll"); +[Ss]hall printf("'ll"); +more printf("more fuckin'"); +than printf("than fuckin'"); +"can " printf("kin "); +"Can " printf("Kin "); +bad printf("bastaad"); +Bad printf("Bastaad"); +nasty printf("bastaad"); +good printf("magic"); +Good printf("Magic"); +great printf("magic"); +Great printf("Magic"); +human printf("yooman"); +woman printf("wumman"); +women printf("wummen"); +" man " printf(" bastaad "); +football printf("futbaal"); +all printf("aal"); +All printf("Aal"); +"the " printf("the fuckin' "); +"what is" printf("what the fuck is"); +"What is" printf("What the fuck is"); +"what are" printf("what the fuck are"); +"What are" printf("What the fuck are"); +"The " printf("The fuckin' "); +"That " printf("That fuckin' "); +" any" printf(" onny fuckin'"); +poof printf("puff"); +homosexual printf("puff"); +gay printf("puff"); +bisexual printf("semi-puff"); +[Mm]iddlesbrough printf("Boro"); +[Mm]iddlesborough printf("Boro"); +[Gg]ateshead printf("Gaatsed"); +[Nn]ewcastle printf("Neecassl"); +"South Shields" printf("Saath Sheels"); +[Ss]cotland printf("Jock"); +[Ss]cotsman printf("Jocko bastaad"); +[Ss]cottish printf("Jock"); +[Ss]paniard printf("Wop"); +[Ss]panish printf("Wop"); +[Ii]talian printf("Wop"); +[Ss]pain printf("Wopland"); +[Ii]taly printf("Wopland"); +them printf("'em"); +home printf("yem"); +" go " printf(" gaan "); +going printf("gannin'"); +" gone " printf(" went "); +trousers printf("kex"); +burnt printf("bornt"); +because printf("cos"); +Because printf("Cos"); +both printf("burth"); +Both printf("Burth"); +" yes " printf(" aye "); +"Yes " printf("Aye "); +" no " printf(" ney "); +"No " printf("Ney "); +"with " printf("wi' "); +wrong printf("wrang"); +told printf("telt"); +"bit of a " printf("birruva "); +"bit of " printf("birra "); +"You're a" printf("Yorra"); +"You are a" printf("Yorra"); +"you're a" printf("yorra"); +"you are a" printf("yorra"); +"We are" printf("Wur"); +" we are" printf(" wur"); +"What a" printf("Worra"); +"what a" printf("worra"); +your printf("y'"); +"you're" printf("yer"); +you printf("ya"); +" him" printf("'m"); +Your printf("Y'"); +"You're" printf("Yer"); +You printf("Ya"); +" our" printf(" wur"); +"Our" printf("Wur"); +"I won't" printf("Will Ah fuck"); +"I refuse to" printf("Will Ah fuck"); +"I will not" printf("Will Ah fuck"); +"I don't" printf("Do Ah fuck"); +"I do not " printf("Do Ah fuck "); +"I didn't" printf("Did Ah fuck"); +"I did not " printf("Did Ah fuck "); +"No." printf("Ney chance."); +"No!" printf("Ney chance!"); +"I'" printf("Ah'"); +"I " printf("Ah "); +" my" printf(" ma"); +" me " printf("'us "); +"We " printf("Wu "); +" we " printf(" wu "); +"were " printf("wus "); +"Were " printf("Wus "); +bastard printf("bastaad"); +into printf("inter"); +" on " printf("'an "); +" for " printf(" f' "); +beer printf("brown"); +" of " printf(" a'"); +[Gg]erman printf("Jorman"); +[Ss]wiss printf("Jorman"); +[Au]strian printf("Jorman"); +right printf("reyt"); +Right printf("Reyt"); +" to " printf(" ter "); +" hit by " printf(" chinned off "); +" kill" printf(" fuck"); +" hitt" printf(" fuck"); +" hit " printf(" fucked "); +" hit" printf(" fuck"); +breast printf("tit"); +bosom printf("tit"); +screwing printf("shaggin'"); +Screwing printf("Shaggin'"); +screw printf("shag"); +kick printf("fuck"); +Kick printf("Fuck"); +"ing " printf("in' "); +ou printf("er"); +"? " printf(", ya bastaad? "); +", sir" printf(", pal"); +", dear" printf(", pet"); +[a-m]", " {ECHO;printf("fuck, ");} +[n-z]", " {ECHO;printf("like, ");} +. printf(yytext); +\n printf("\n"); +%% +main() +{ + yylex(); +} diff --git a/buck.l b/buck.l new file mode 100644 index 0000000..2568f2b --- /dev/null +++ b/buck.l @@ -0,0 +1,85 @@ +%e 2000 +%p 5000 +%n 1000 +%k 500 +%a 4000 +%o 2000 + +%{ +/* +** +** The buckwheat filter +** by Benjamin Elijah Griffin 29 March 1995 +** +** A lex utility written as a favor for a friend. (He provided the +** rules, I showed him how to make a lex filter out of them.) +** +** compile like this: +** lex buck.l +** cc -o buck lex.yy.c -ll +** rm lex.yy.c +** +** use like this: +** buck < infile > outfile +** or +** cat infile | | buck | > outfile +** +*/ + +char WhAt[]="@(#)Benjamin Elijah Griffin's buck filter for buckwheat (c) 1995\n@(#)$Header:$" +; + +%} + +%% + +okay printf("otay"); +Okay printf("Otay"); +the printf("da"); +The printf("Da"); +ing[ .,;!?] printf("in'%s",yytext+3); +" for " printf(" po' "); +" in " printf(" bin "); +love printf("nub"); +Love printf("Nub"); +" ll" printf(" d"); +Ll printf("D"); +" l" printf(" w"); +L printf("W"); +ll { printf("ww"); /* hmm, do we really want that? */ } +l { 1+1; /* cutesy null statement */ } +" ch" printf(" t"); +Ch printf("T"); +" h" printf(" n"); +H printf("H"); +" r"[aeiou] printf("%s",yytext+2); +R[aeiou] printf("R%s",toupper(*(yytext+1))); +r[^ .,;!?] printf("%s",yytext+1); +" t" printf(" d"); +T printf("D"); +" g" printf(" b"); +G printf("B"); +th printf("d"); +n[a-z][ .,;!?] printf("n%s",yytext+2); +wi printf("bi"); +Wi printf("Bi"); +" sh" printf(" t"); +Sh printf("T"); +" "s[aeiou] printf(" t%s",yytext+2); +S[aeiou] printf("T%s",yytext+1); +" "s[qwrtypsdfghjklzxcvbnm] printf(" %s",yytext+2); +S[qwrtypsdfghjklzxcvbnm] printf("%s",yytext+1); +" "c[aou] printf(" %s",yytext+2); +C[aou] printf("C%c",toupper(*(yytext+1))); +" "r[aeiou] printf(" %s",yytext+2); +R[aeiou] printf("R%c",toupper(*(yytext+1))); + +. printf("%s",yytext); + +%% + +main() +{ + yylex(); +} + diff --git a/censor.l b/censor.l new file mode 100644 index 0000000..840528a --- /dev/null +++ b/censor.l @@ -0,0 +1,103 @@ +%{ +#define yywrap() 1 +%} + +T [" .!?,"]* + +%% + +"ass" printf("[BUTTOCKS]"); +"ASS" printf("[BUTTOCKS]"); +"Ass" printf("[BUTTOCKS]"); +"Damn" printf("[CURSE]"); +"damn" printf("[CURSE]"); +"DAMN" printf("[CURSE]"); +"fuck" printf("[FORNICATE]"); +"Fuck" printf("[FORNICATE]"); +"FUCK" printf("[FORNICATE]"); +"shit" printf("[EXCREMENT]"); +"Shit" printf("[EXCREMENT]"); +"SHIT" printf("[EXCREMENT]"); +"bitch" printf("[FEMALE DOG]"); +"Bitch" printf("[FEMALE DOG]"); +"BITCH" printf("[FEMALE DOG]"); +"pecker" printf("[PHALLUS]"); +"Pecker" printf("[PHALLUS]"); +"PECKER" printf("[PHALLUS]"); +"nipple" printf("[MAMMARY OUTLET]"); +"Nipple" printf("[MAMMARY OUTLET]"); +"NIPPLE" printf("[MAMMARY OUTLET]"); +"breast" printf("[BUSOM]"); +"Breash" printf("[BUSOM]"); +"BREAST" printf("[BUSOM]"); +"fucking" printf("[FORNICATING]"); +"Fucking" printf("[FORNICATING]"); +"FUCKING" printf("[FORNICATING]"); +"fucked" printf("[FORNICATED]"); +"Fucked" printf("[FORNICATED]"); +"FUCKED" printf("[FORNICATED]"); +"damned" printf("[CURSED]"); +"Damned" printf("[CURSED]"); +"DAMNED" printf("[CURSED]"); +"damning" printf("[CURSING]"); +"Damning" printf("[CURSING]"); +"DAMNING" printf("[CURSING]"); +"piss" printf("[URINATE]"); +"Piss" printf("[URINATE]"); +"PISS" printf("[URINATE]"); +"asshole" printf("[DONKEY BUTTOCKS]"); +"Asshole" printf("[DONKEY BUTTOCKS]"); +"ASSHOLE" printf("[DONKEY BUTTOCKS]"); +"prick" printf("[PHALLUS]"); +"Prick" printf("[PHALLUS]"); +"PRICK" printf("[PHALLUS]"); +"cock" printf("[PHALLUS]"); +"Cock" printf("[PHALLUS]"); +"COCK" printf("[PHALLUS]"); +"pussy" printf("[VAGINA]"); +"Pussy" printf("[VAGINA]"); +"PUSSY" printf("[VAGINA]"); +"twat" printf("[VAGINA]"); +"Twat" printf("[VAGINA]"); +"TWAT" printf("[VAGINA]"); +"cunt" printf("[VAGINA]"); +"Cunt" printf("[VAGINA]"); +"CUNT" printf("[VAGINA]"); +"dick" printf("[RICHARD]"); +"Dick" printf("[RICHARD]"); +"DICK" printf("[RICHARD]"); +"cum" printf("[EJACULATE]"); +"Cum" printf("[EJACULATE]"); +"CUM" printf("[EJACULATE]"); +"jack off" printf("[MASTERBATE]"); +"Jack Off" printf("[MASTERBATE]"); +"JACK OFF" printf("[MASTERBATE]"); +"wet dream" printf("[NOCTURNAL EMISSION]"); +"Wet Dream" printf("[NOCTURNAL EMISSION]"); +"WET DREAM" printf("[NOCTURNAL EMISSION]"); +"jerk off" printf("[MASTERBATE]"); +"Jerk Off" printf("[MASTERBATE]"); +"JERK OFF" printf("[MASTERBATE]"); +"bastard" printf("[ILLEGITIMATE CHILD]"); +"Bastard" printf("[ILLEGITIMATE CHILD]"); +"BASTARD" printf("[ILLEGITIMATE CHILD]"); +"slut" printf("[WANTON WOMAN]"); +"Slut" printf("[WANTON WOMAN]"); +"SLUT" printf("[WANTON WOMAN]"); +"whore" printf("[PROSTITUTE]"); +"Whore" printf("[PROSTITUTE]"); +"WHORE" printf("[PROSTITUTE]"); +"suck" printf("[INHALE]"); +"Suck" printf("[INHALE]"); +"SUCK" printf("[INHALE]"); +"blow" printf("[EXHALE]"); +"Blow" printf("[EXHALE]"); +"BLOW" printf("[EXHALE]"); +. ECHO; +%% + +main() +{ + srand(getpid()); + yylex(); +} diff --git a/chef b/chef new file mode 100755 index 0000000..23d0e6a --- /dev/null +++ b/chef @@ -0,0 +1,67 @@ +#!/usr/bin/perl -p +# Swedish Chef filter. Bork Bork Bork! +# Copyright 1999 by Joey Hess under the terms of the GNU GPL. + +# Note that the order of the commands in this program is very important! + +# Change 'e' at the end of a word to 'e-a', but don't mess with the word +# "the". +s{(\w+)e(\b)}{ + if (lc($1) ne 'th') { + "$1e-a$2" + } + else { + "$1e$2" + } +}eg; + +# Stuff that happens at the end of a word. +s/en(\b)/ee$1/g; +s/th(\b)/t$1/g; + +# Stuff that happens if not the first letter of a word. +s/(\w)f/$1ff/g; + +# Change 'o' to 'u' and at the same time, change 'u' to 'oo'. But only +# if it's not the first letter of the word. +tr/ou/uo/; +s{(\b)([uo])}{ + $1 . $2 eq 'o' ? 'u' : 'o' +}eg; +# Note that this also handles doubling "oo" at the beginning of words. +s/o/oo/g; +# Have to double "Oo" seperatly. +s/(\b)O(\w)/$1Oo$2/g; +# Fix the word "bork", which will have been mangled to "burk" +# by above commands. Note that any occurence of "burk" in the input +# gets changed to "boork", so it's completly safe to do this: +s/\bburk\b/bork/; + +# Stuff to do to letters that are the first letter of any word. +s/\be/i/g; +s/\bE/I/g; + +# Stuff that always happens. +s/teeun/shun/g; # this actually has the effect of changing "tion" to "shun". +s/the/zee/g; +s/The/Zee/g; +tr/vVwW/fFvV/; + +# Stuff to do to letters that are not the last letter of a word. +s/a(?!\b)/e/g; +s/A(?!\b)/E/g; + +s/en/un/g; # this actually has the effect of changing "an" to "un". +s/En/Un/g; # this actually has the effect of changing "An" to "Un". +s/eoo/oo/g; # this actually has the effect of changing "au" to "oo". +s/Eoo/Oo/g; # this actually has the effect of changing "Au" to "Oo". + +# Change "ow" at end of word to "oo". +s/uv\b/oo\b/g; + +# Change 'i' to 'ee', but not at the beginning of a word, +# and only affect the first 'i' in each word. +s/(\b\w[a-hj-zA-HJ-Z]*)i/$1ee/g; + +# Special punctuation of the end of sentances but only at end of lines. +s/([.?!])$/$1\nBork Bork Bork!/g; diff --git a/chef.l b/chef.l new file mode 100644 index 0000000..7e8ea13 --- /dev/null +++ b/chef.l @@ -0,0 +1,63 @@ +%{ +/* chef.x - convert English on stdin to Mock Swedish on stdout + * + * The WC definition matches any word character, and the NW definition matches + * any non-word character. Two start conditions are maintained: INW (in word) + * and NIW (not in word). The first rule passes TeX commands without change. + * + * HISTORY + * + * Apr 26, 1993; John Hagerman: Added ! and ? to the Bork Bork Bork rule. + * + * Apr 15, 1992; John Hagerman: Created. + */ + +static int i_seen = 0; +%} + +WC [A-Za-z'] +NW [^A-Za-z'] + +%start INW NIW + +%% + +\\[^ \n]+ ECHO; + +{NW} { BEGIN NIW; i_seen = 0; ECHO; } +[.!?]$ { BEGIN NIW; i_seen = 0; + printf("%c\nBork Bork Bork!",yytext[0]); } + +"bork"/{NW} ECHO; +"Bork"/{NW} ECHO; + +"an" { BEGIN INW; printf("un"); } +"An" { BEGIN INW; printf("Un"); } +"au" { BEGIN INW; printf("oo"); } +"Au" { BEGIN INW; printf("Oo"); } +"a"/{WC} { BEGIN INW; printf("e"); } +"A"/{WC} { BEGIN INW; printf("E"); } +"en"/{NW} { BEGIN INW; printf("ee"); } +"ew" { BEGIN INW; printf("oo"); } +"e"/{NW} { BEGIN INW; printf("e-a"); } +"e" { BEGIN INW; printf("i"); } +"E" { BEGIN INW; printf("I"); } +"f" { BEGIN INW; printf("ff"); } +"ir" { BEGIN INW; printf("ur"); } +"i" { BEGIN INW; printf(i_seen++ ? "i" : "ee"); } +"ow" { BEGIN INW; printf("oo"); } +"o" { BEGIN INW; printf("oo"); } +"O" { BEGIN INW; printf("Oo"); } +"o" { BEGIN INW; printf("u"); } +"the" { BEGIN INW; printf("zee"); } +"The" { BEGIN INW; printf("Zee"); } +"th"/{NW} { BEGIN INW; printf("t"); } +"tion" { BEGIN INW; printf("shun"); } +"u" { BEGIN INW; printf("oo"); } +"U" { BEGIN INW; printf("Oo"); } +"v" { BEGIN INW; printf("f"); } +"V" { BEGIN INW; printf("F"); } +"w" { BEGIN INW; printf("v"); } +"W" { BEGIN INW; printf("V"); } + +. { BEGIN INW; ECHO; } diff --git a/cockney.l b/cockney.l new file mode 100644 index 0000000..e6c0bda --- /dev/null +++ b/cockney.l @@ -0,0 +1,190 @@ +%{ +/* + * Lex filter to transform plain English into Cockney English. + * No racial or societal slurs are intended. For amusement only. + * + * Copyright 1986 by Daniel Klein. + * + * Reproduction permitted so long as this notice is retained. + */ +%} + +BW [ \t\n] +SP [ \t]+ +EW [ \t.,;!\?$] + +%Start junk + +%% +. { srandom(time(0L)); unput(yytext[0]); BEGIN 0; } +{BW}[Tt]he{EW} { ECHO; bloody(); } +{BW}[Ss]teal{EW} { printf("%c%cick",yytext[0],yytext[1]-5); + eos(); + } +{BW}[Ss]tole{EW} { printf("%c%cicked",yytext[0],yytext[1]-5); + eos(); + } +{BW}tired pooped(); +{BW}were{EW} | +{BW}was{EW} { printf("%cwuz",yytext[0]); eos(); } +[Hh]ello printf("'%cllo", caseify('u')); +{BW}[Hh] printf("%c'",yytext[0]); +{BW}[Yy]our{EW} { printf("%.2ser",yytext); eos(); } +{BW}it{EW} { printf("%.2s'",yytext); eos(); } +{BW}go{EW} { printf("%.2sow",yytext); eos(); } +{BW}and{EW} { printf("%c'n'",yytext[0]); eos(); } +{BW}my{EW} { printf("%.2se",yytext); eos(); } +{BW}th(is|at){EW} { printf("%.5s", yytext); eos(); } +{BW}[Ww]e{SP}went{EW} | +{BW}[Ww]e{SP}had{EW} | +{BW}[Ww]e{SP}did{EW} { printf("%.*s",yyleng-1,yytext); + set_did(2); + eos(); + } +{BW}I{SP}went{EW} | +{BW}I{SP}had{EW} | +{BW}I{SP}did{EW} { I(); + printf(" did"); + set_did(1); + eos(); + } +{BW}I{EW} { I(); eos(); } + +[Yy]ou{SP}[^aeiouy] { printf("%c'", yytext[0]); plastc(); } +[Ww]hat{SP}are{EW} { printf("%cotta", yytext[0]); eos(); } + +{BW}other | +[MmNnRr]other printf("%cuvver",yytext[0]); +[MmSs]outh printf("%cowf", yytext[0]); +[cYy]outh printf("%coof", yytext[0]); +[^o]uth printf("%.2sf",yytext); +{BW}th[^e] | +[AaEeIiOo]th[^em] { printf("%cf",yytext[0]); plastc(); } +oothe | +e[ei]the { printf("%c%cve", yytext[0], yytext[0]); } +ooth | +eeth { printf("%c%cf", yytext[0], yytext[0]); } +[aei]the { printf("%cvv",yytext[0]); plastc(); } +th putchar('v'); +a[km]e{EW} { printf("i%ce",yytext[1]); eos(); } +[^r][Oo]ld printf("%.2swld",yytext); +[^AaEeIiOoUu][uo]nd[a-z] printf("%cunn%c",yytext[0],yytext[yyleng-1]); +ing{EW} { printf("in'"); eos(); } +[^dg]get+[^h] printf("%cge'%c",yytext[0],yytext[yyleng-1]); +ail printf("aiw"); +any printf("enny"); +[rSs]ay{EW} { printf("%cigh",yytext[0]); eos(); } +way printf("why"); +[BbHh]it{EW} { printf("%ci'",yytext[0]); eos(); } +ait{EW} { printf("ite"); eos(); } +ime{EW} { printf("oime"); eos(); } +[^e]ize[^n] printf("%coize%c",yytext[0],yytext[yyleng-1]); +[^e]ight printf("%coit",*yytext); +[a-z]"?" { *(yytext+1) = ','; + printf("%s roit?",yytext); + clear_did(); + } +[a-z]"." { printf("%c", yytext[0]); dintI(); } +\n printf("\n"); + +%% + +eos() +{ + if (yytext[yyleng-1] == '.') + dintI(); + else + unput(yytext[yyleng-1]); +} + +plastc() +{ + unput(yytext[yyleng-1]); +} + +caseify(c) +char c; +{ + if (yytext[0] <= 'Z') + return (c - ' '); + else + return (c); +} + + +I() +{ +/* extern long random(); */ + + if (random() % 100 < 20) + printf("%cOy",yytext[0]); + else + printf("%cI",yytext[0]); +} + +static short b_count = 0; +static short b_which = 0; + +bloody() +{ + if (b_count++ % 2 == 0) { + switch (b_which++ % 4) { + case 0: printf("bloody "); break; + case 1: printf("flinkin' "); break; + case 2: printf("bleedin' "); break; + case 3: printf("soddin' "); break; + } + } +} + +static short did = 0; + +set_did(val) +{ + did = val; +} + +clear_did() +{ + did = 0; +} + +dintI() +{ +/* extern long random(); */ + + if ((did == 1) && (random() % 100 < 50)) + printf(", didn'I?"); + else if ((did == 2) && (random() % 100 < 50)) + printf(", din't we?"); + else + printf("."); + clear_did(); +} + +pooped() +{ +/* extern long random(); */ + + switch (random() % 3) { + case 0: + printf("%cknackered", yytext[0]); + break; + case 1: + printf("%cshagged out", yytext[0]); + break; + case 2: + printf("%cdone in", yytext[0]); + break; + } +} + +expletive() +{ +/* +Blimey +Stright a light +'Strewth +Cor blimey +*/ +} diff --git a/debian/TODO b/debian/TODO new file mode 100644 index 0000000..09845a3 --- /dev/null +++ b/debian/TODO @@ -0,0 +1,3 @@ +* censor filter (should be easy) +* continue to make the chef filter more similar to the old one +* write more filters diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..520b0b6 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,40 @@ +filters (1.3) unstable; urgency=low + + * Libc6. + * Added man pages. #11318 + + -- Joey Hess Wed, 16 Jul 1997 13:31:07 -0400 + +filters (1.2) frozen unstable; urgency=low + + * Fixed bug #8329 (buck segfaulted if it encountered C[aou] or R[aeiou] in + input.) + * Routine update of debian/rules: + Run dpkg-gencontrol after debstd, and delete substvars during clean. + + -- Joey Hess Tue, 8 Apr 1997 20:59:12 -0400 + +filters (1.1) unstable; urgency=low + + * Changed version number to 1.1, because there was some confusion if this + was a debian-only package. It is, so I've removed the debian revision + number. + + -- Joey Hess Tue, 24 Dec 1996 20:35:51 -0500 + +filters (1.0-2) unstable; urgency=low + + * New email address. + * Use debmake. + + -- Joey Hess Tue, 24 Dec 1996 15:40:55 -0500 + +filters (1.0-1) unstable; urgency=low + + * First release. + + -- Joey Hess Sat, 28 Sep 1996 00:55:40 -0400 + +Local variables: +mode: debian-changelog +End: diff --git a/debian/config b/debian/config new file mode 100644 index 0000000..db4d289 --- /dev/null +++ b/debian/config @@ -0,0 +1,65 @@ +# Edit this file to configure debian/rules to build a package. +# No modification of debian/rules should be neccessary. (Famous last words!) +# +# File by Joey Hess + +# What is the name of this package? +package=filters + +# Files that go in directories under /doc. +docs=README ky00te.dir/README.ky00te SAMPLES +copyright=debian/copyright + +# What file must exist in the current directory if the package is +# properly unpacked here? +test_file=makesample.sh + +# Does this package build from an Imakefile? +# If so, uncomment the line below. +#use_imakefile=y + +# Does this package build from a Configure script? +# If so, uncomment the line below and enter the command to run to run the +# Configure script (ie: "./Configure") +#use_configure=./Configure + +# What commands to run to build the package? +define build_command + $(MAKE) + $(MAKE) samples +endef + +# What commands to run to clean up after a build? +define clean_command + -$(MAKE) -i clean +endef + +# List here any files that must be removed during "debian/rules clean" +# that clean_command doesn't take care of. +clean_files= + +# List here any files that should be preserved during a build, and restored +# to their original state during a clean. For example, if the package comes +# with both an Imakefile and a Makefile, and xmkmf is run, list the original +# Makefile here so it will be backed up before it is overwritten my xmkmf. +preserve_files= + +# What command to run to install the package into debian/tmp? +# You might want to edit the package's Makefile and add $(PREFIX) +# to all the paths it installs files to. or, you can just write +# your own install commands here instead. +# +# Note that debian/* and the files in /usr/doc will be installed +# properly for you, you don't need to do that here. +# +define install_command + $(MAKE) PREFIX=debian/tmp install +endef + +# After being installed in debian/tmp, everything is chowned to root.root, +# and chmod g-ws is run on everyything. Enter below any chmod commands you +# need to run to set files to the proper permissions. This is where you +# can make programs be suid, etc. +# (Note that these commands will be run as root.) +define ch_commands +endef diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..f4871da --- /dev/null +++ b/debian/control @@ -0,0 +1,13 @@ +Source: filters +Section: games +Priority: optional +Maintainer: Joey Hess +Standards-Version: 2.1.1.0 + +Package: filters +Architecture: any +Depends: ${shlibs:Depends} +Description: a collection of filters, including B1FF and the swedish chef + A collection of filters to do all sorts of strange things to text. + This includes such favorites as B1FF and the swedish chef, as well as lots + of other filters. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..53b2e1b --- /dev/null +++ b/debian/copyright @@ -0,0 +1,60 @@ +This is a Debian prepackaged version of the filters package. + +This package was put together and debianized by Joey Hess +, using sources from all over, including: + http://www.princeton.edu/~mkporwit/pub_links/davido/slang/ + http://www.mathlab.sunysb.edu/~elijah/src.html + +Various copyrights pertain to different files in this package: + +cockney filter: +/* + * Lex filter to transform plain English into Cockney English. + * No racial or societal slurs are intended. For amusement only. + * + * Copyright 1986 by Daniel Klein. + * + * Reproduction permitted so long as this notice is retained. + */ + +jive filter: +/* + * Lex filter to transform plain English into Jive English. + * No racial or societal slurs are intended. For amusement only. + * + * Copyright 1986 by Daniel Klein and Clement Cole. + * + * Reproduction permitted so long as this notice is retained. + */ + +newspeak filter: + * newspeak.l, version 1.1. + * Lex filter to transform plain English into NewSpeak. + * Copyright (c) 1991 Jamie Zawinski . + * Permission granted for noncommercial use and redistribution. + +nyc filter: +/* + * Lex filter to transform plain English into Brooklyn English. + * No racial or societal slurs are intended. For amusement only. + * + * Copyright 1986 by Daniel Klein. + * + * Reproduction permitted so long as this notice is retained. + */ + +ky00te filter: + +This program is (c) 1994, Brent E. Edwards. Feel free to distribute the +complete program world-wide. (Please do NOT break apart this text file +from the program.) + +This program is under absolutely no warrantee of any kind. + +If you have any questions about this program, please send them to +edwardsb@cs.rpi.edu. + +This program is dedicated to Conrad Wong. + +This program is catware. If you find it useful in any way, pay for this +program by spending one hour petting one or several cats. diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..101fcb3 --- /dev/null +++ b/debian/rules @@ -0,0 +1,136 @@ +#!/usr/bin/make -f +############################################################################## +# Generic debian/rules file. Based on: +# +#> Sample debian.rules file - for GNU Hello (1.3). +#> Copyright 1994,1995 by Ian Jackson. +#> I hereby give you perpetual unlimited permission to copy, +#> modify and relicense this file, provided that you do not remove +#> my name from the file itself. (I assert my moral right of +#> paternity under the Copyright, Designs and Patents Act 1988.) +# +# Heavily modified by Joey Hess +# +############################################################################## +# +# NOTE: You shouldn't have to edit this file. Edit debian/config instead. +# If you must edit this file to get your package to build properly, then +# I have failed. Let me know; mail me. +# +# (Currently not handled: multiple binary packages from 1 source package, +# and binary-indep rule.) +# +# NOTE: This file is designed so it doesn't need to be run as root. For +# actions that require that the user be root, the root password will be +# prompted for, if you're not already root. +# +############################################################################## +# +# Changelog: +# * Fakeroot and sudo fixes. +# * Run dpkg-gencontrol after debstd, and delete substvars during clean. +# * Clean up junk files in subdirs. +# * Modifications for multiple binary package support. +# * Call debstd after fixing file perms. +# * Don't pass package name to debstd + fixes for multi binary packages. +# * Use build-stamp instead of build. +# * New email address. +# * Added changelog. +# +############################################################################## + +# Include config file. +include debian/config + +# Generate a makefile (via configure scriopt or xmkmf). +makefile-stamp: + ifeq ($(strip $(use_imakefile)),y) + xmkmf -a + endif + $(use_configure) + touch makefile-stamp + +# Preserve some files that may get deleted/overwritten/modified otherwise. +preserve-stamp: + ifneq ($(strip $(preserve_files)),) + $(foreach file,$(preserve_files),cp $(file) $(file).preserved ;) + endif + touch preserve-stamp + +build-stamp: preserve-stamp makefile-stamp + $(checkdir) + $(build_command) + touch build-stamp + +build: build-stamp + +clean: preserve-stamp makefile-stamp + $(checkdir) + # Do actual cleaning up here. + -rm -f build-stamp + $(clean_command) + -find . -name '\#*\#' -o -name '*~' -o -name 'DEADJOE' -exec rm -f {} \; + -rm -f debian/files* debian/substvars debian/*.substvars $(clean_files) + $(clean_tmp) + # Remove Makefile that xmkmf creates. + ifeq ($(strip $(use_imakefile)),y) + -rm -f Makefile + endif + # If we preserved some files, we need to restore them now. + ifneq ($(strip $(preserve_files)),) + $(foreach file,$(preserve_files),mv -f $(file).preserved $(file); ) + endif + -rm -f preserve-stamp makefile-stamp + +# Build architecture-independent files here. +# (not yet set up to be used) +binary-indep: build + $(checkdir) + +# Build architecture-dependent files here. +binary-arch: build + $(checkdir) + $(clean_tmp) + $(install_command) + # Set permissions and check package for problems, then build package. + @if [ "`whoami`" != root ]; then \ + echo -e "\n ** Enter root password to set file permissions."; \ + sudo debian/rules setperms; \ + else \ + debian/rules setperms; \ + fi + +# This must be run suid root, it sets the file permissions in debian/tmp +setperms: + chown -R root.root debian/tmp + chmod -R g-ws debian/tmp + # Debstd handles lots of nasty details. This requires that the debmake + # package is installed. + -debstd $(debstd) $(docs) + dpkg-gencontrol -p$(package) + $(ch_commands) + dpkg --build debian/tmp .. + +define checkdir + @test -e $(test_file) -a -f debian/rules || (echo -e "\n\ + ** \"$(test_file)\" or \"debian/rules\" does not exist.\n\ + ** Either the package is not unpacked in this directory, or\n\ + ** an incorrect test_file is specified in debian/config.\n" && false) +endef + +# This rm's the debian/tmp directory, and any other directories specified in +# tmpdirs +define clean_tmp + -rm -rf debian/tmp >/dev/null 2>&1 + @if [ -d debian/tmp -o -n "$(tmp_dirs)" ]; then \ + if [ "`whoami`" != root ]; then \ + echo -e "\n ** Enter root password to remove temporary directories $(tmp_dirs)"; \ + sudo rm -rf debian/tmp $(tmp_dirs); \ + else \ + rm -rf debian/tmp $(tmp_dirs); \ + fi; \ + fi +endef + +binary: binary-indep binary-arch +.PHONY: clean setperms binary diff --git a/drawl.l b/drawl.l new file mode 100644 index 0000000..ae73df1 --- /dev/null +++ b/drawl.l @@ -0,0 +1,426 @@ +%{ +/* Title: English to Texan translator + * Author: Adam Hudd (adam@dadhb1.ti.com) + * Date: 5 March 1991 + * Version: 1.0 + * + * Input: stdin + * Output: stdout + * compile: flex -iL drawl.l ; cc -O lex.yy.c -o drawl + */ + +#include +#include + +void changeCase(); +%} +%% +(^|" ")"American" changeCase(" Amerkin"); +(^|" ")"California" changeCase(" Caleyfornyuh"); +(^|" ")"Dallas" changeCase(" Big D."); +(^|" ")"Fort Worth" changeCase(" Fowert Wurth"); +(^|" ")"Houston" changeCase(" Useton"); +(^|" ")"I don't know" changeCase(" I-O-no"); +(^|" ")"I will"|" I'll" changeCase(" Ahl"); +(^|" ")"I would" changeCase(" Ahd"); +(^|" ")"I " changeCase(" Ah "); +(^|" ")"I'm "|" I am " changeCase(" Ahm "); +(^|" ")"I've "|" I have " changeCase(" Ahv "); +(^|" ")"Mexico" changeCase(" Messyco"); +(^|" ")"San Antonio" changeCase(" Santone"); +(^|" ")"TV"|" television"|" telly" changeCase(" tayvay"); +(^|" ")"Texan" changeCase(" Texun"); +(^|" ")"Texas" changeCase(" Teksus"); +(^|" ")"a while " changeCase(" uhwahl "); +(^|" ")"a " changeCase(" uh "); +(^|" ")"about" changeCase(" bout"); +(^|" ")"adult" changeCase(" a-dult"); +(^|" ")"afraid" changeCase(" frayed"); +(^|" ")"and " changeCase(" an "); +(^|" ")"anniversary" changeCase(" anavarsry"); +(^|" ")"any " changeCase(" no "); +(^|" ")"anywhere" changeCase(" anywhare"); +(^|" ")"appreciate" changeCase(" preshate"); +(^|" ")"april" changeCase(" abrul"); +(^|" ")"are going to" changeCase(" sargunna"); +(^|" ")"are known" changeCase(" iz node"); +(^|" ")"are " changeCase(" is "); +(^|" ")"aren't you" changeCase(" arncha"); +(^|" ")"at them" changeCase(" attum"); +(^|" ")"august" changeCase(" awg-ghust"); +(^|" ")"away" changeCase(" awf"); +(^|" ")"awkward" changeCase(" aukerd"); +(^|" ")"bad" changeCase(" bayud"); +(^|" ")"ball" changeCase(" bawl"); +(^|" ")"baptists" changeCase(" babtusses"); +(^|" ")"barbed" changeCase(" bob"); +(^|" ")"be " changeCase(" bay "); +(^|" ")"bear" changeCase(" bayur"); +(^|" ")"beautiful" changeCase(" butiful"); +(^|" ")"because" changeCase(" cuz"); +(^|" ")"believe" changeCase(" bleeve"); +(^|" ")"bitty" changeCase(" biddy"); +(^|" ")"black" changeCase(" blaak"); +(^|" ")"blue" changeCase(" bulloo"); +(^|" ")"born" changeCase(" bornd"); +(^|" ")"brake" changeCase(" brayke"); +(^|" ")"break" changeCase(" brayke"); +(^|" ")"brick" changeCase(" breck"); +(^|" ")"brighter" changeCase(" brotter"); +(^|" ")"bringing" changeCase(" brangin"); +(^|" ")"brown" changeCase(" braoyone"); +(^|" ")"building" changeCase(" bildun"); +(^|" ")"bulb" changeCase(" bub"); +(^|" ")"call you " changeCase(" cawya "); +(^|" ")"called you " changeCase(" cawdja "); +(^|" ")"camera" changeCase(" Instuhmatik"); +(^|" ")"can't" changeCase(" kaynt"); +(^|" ")"can't"|" can not"|" cannot" changeCase(" kaynt"); +(^|" ")"capital" changeCase(" captul"); +(^|" ")"car " changeCase(" cawer "); +(^|" ")"catch" changeCase(" ketch"); +(^|" ")"chair" changeCase(" chayer"); +(^|" ")"cheer" changeCase(" chair"); +(^|" ")"chicken" changeCase(" chikun"); +(^|" ")"child" changeCase(" kid"); +(^|" ")"children" changeCase(" kids"); +(^|" ")"clean" changeCase(" klane"); +(^|" ")"climate" changeCase(" kliment"); +(^|" ")"cold" changeCase(" code"); +(^|" ")"darker" changeCase(" dawerker"); +(^|" ")"deaf" changeCase(" dayuf"); +(^|" ")"death" changeCase(" dayuth"); +(^|" ")"december" changeCase(" deceyumbur"); +(^|" ")"definite" changeCase(" defnut"); +(^|" ")"did not"|" didn't" changeCase(" didunt"); +(^|" ")"did you" changeCase(" dja"); +(^|" ")"didn't it" changeCase(" diduhnit"); +(^|" ")"different" changeCase(" difernt"); +(^|" ")"difficult" changeCase(" difahkult"); +(^|" ")"divide" changeCase(" duhvide"); +(^|" ")"does" changeCase(" duz"); +(^|" ")"doesn't" changeCase(" don't"); +(^|" ")"dog " changeCase(" dawg "); +(^|" ")"I don't care" changeCase(" don't make no nevur mind to may "); +(^|" ")"door" changeCase(" dower"); +(^|" ")"dreaming" changeCase(" draimun"); +(^|" ")"drink" changeCase(" drank"); +(^|" ")"drinking" changeCase(" drankin"); +(^|" ")"drive" changeCase(" drahv"); +(^|" ")"eight" changeCase(" ate"); +(^|" ")"eighteen" changeCase(" a-tane"); +(^|" ")"eighth" changeCase(" athd"); +(^|" ")"eighty" changeCase(" ady"); +(^|" ")"eleven" changeCase(" lebum"); +(^|" ")"entire" changeCase(" entahr"); +(^|" ")"especially" changeCase(" speshuly"); +(^|" ")"even" changeCase(" evun"); +(^|" ")"evening" changeCase(" eevnun"); +(^|" ")"eventually" changeCase(" eventchly"); +(^|" ")"ever" changeCase(" evur"); +(^|" ")"every once in a while" changeCase(" evurwonsinawhahl"); +(^|" ")"every" changeCase(" evur"); +(^|" ")"exactly" changeCase(" zakly"); +(^|" ")"executive" changeCase(" zekatuv"); +(^|" ")"eye " changeCase(" ah "); +(^|" ")"father" changeCase(" papa"); +(^|" ")"february" changeCase(" febberyawary"); +(^|" ")"fell " changeCase(" fayul "); +(^|" ")"fifteen" changeCase(" fiftane"); +(^|" ")"fifth" changeCase(" fifd"); +(^|" ")"fifty" changeCase(" fifdy"); +(^|" ")"fight" changeCase(" fite"); +(^|" ")"figure" changeCase(" figger"); +(^|" ")"filling" changeCase(" fillin"); +(^|" ")"fine" changeCase(" fahn"); +(^|" ")"fire" changeCase(" far"); +(^|" ")"first" changeCase(" fursd"); +(^|" ")"five" changeCase(" fav"); +(^|" ")"fixing" changeCase(" fixin"); +(^|" ")"flower" changeCase(" flare"); +(^|" ")"follow" changeCase(" faller"); +(^|" ")"for " changeCase(" fahwar "); +(^|" ")"forget" changeCase(" fergit"); +(^|" ")"fork" changeCase(" fowerk"); +(^|" ")"forty" changeCase(" fardy"); +(^|" ")"four" changeCase(" fower"); +(^|" ")"fourteen" changeCase(" fortane"); +(^|" ")"fourth" changeCase(" fowerth"); +(^|" ")"freeze" changeCase(" fraze"); +(^|" ")"friday" changeCase(" frydy"); +(^|" ")"from" changeCase(" frum"); +(^|" ")"front" changeCase(" frunt"); +(^|" ")"gas" changeCase(" gayus"); +(^|" ")"geography" changeCase(" joggerfee"); +(^|" ")"get a hold of you" changeCase(" gittaholdayew"); +(^|" ")"get" changeCase(" git"); +(^|" ")"going to" changeCase(" gunna"); +(^|" ")"going to" changeCase(" mona"); +(^|" ")"gold" changeCase(" gode"); +(^|" ")"got to " changeCase(" gotta "); +(^|" ")"green" changeCase(" grane"); +(^|" ")"grey"|" gray" changeCase(" graey"); +(^|" ")"guests" changeCase(" guesss"); +(^|" ")"guitar" changeCase(" gitahwer"); +(^|" ")"gulf" changeCase(" guf"); +(^|" ")"hard" changeCase(" hayud"); +(^|" ")"have a " changeCase(" havuh "); +(^|" ")"have not"|" haven't" changeCase(" habumt"); +(^|" ")"have " changeCase(" hav "); +(^|" ")"he " changeCase(" hay "); +(^|" ")"headed" changeCase(" hardud"); +(^|" ")"here" changeCase(" hare"); +(^|" ")"high" changeCase(" ha"); +(^|" ")"hour" changeCase(" air"); +(^|" ")"how are you" changeCase(" hyeru"); +(^|" ")"how do you do " changeCase(" howdee "); +(^|" ")"huh!" changeCase(" hawh!"); +(^|" ")"huh?" changeCase(" hawh?"); +(^|" ")"hundred" changeCase(" hunnerd"); +(^|" ")"if I " changeCase(" fah "); +(^|" ")"if it " changeCase(" hifit "); +(^|" ")"if you" changeCase(" few"); +(^|" ")"if " changeCase(" hif "); +"ing " changeCase("in' "); +(^|" ")"ignorance" changeCase(" ignernt"); +(^|" ")"indian" changeCase(" hinyun"); +(^|" ")"inside" changeCase(" n-sod"); +(^|" ")"instead of" changeCase(" instudda"); +(^|" ")"institute" changeCase(" instatoot"); +(^|" ")"intersection" changeCase(" innersekshun"); +(^|" ")"is a " changeCase(" izza "); +(^|" ")"is it " changeCase(" izit "); +(^|" ")"is that " changeCase(" izzat "); +(^|" ")"is that right " changeCase(" zatrot "); +(^|" ")"is " changeCase(" iz "); +(^|" ")"isn't it " changeCase(" hiduhnit "); +(^|" ")"it appears" changeCase(" pears"); +(^|" ")"it would" changeCase(" hid"); +(^|" ")"it " changeCase(" hit "); +(^|" ")"it'd " changeCase(" hid "); +(^|" ")"it's"|" it is" changeCase(" hit's"); +(^|" ")"jail" changeCase(" jayul"); +(^|" ")"january" changeCase(" janyawary"); +(^|" ")"jeans" changeCase(" janes"); +(^|" ")"jet" changeCase(" jeyut"); +(^|" ")"jewelry" changeCase(" julry"); +(^|" ")"july" changeCase(" djoolie"); +(^|" ")"june" changeCase(" djoon"); +(^|" ")"just" changeCase(" gist"); +(^|" ")"kind of" changeCase(" kinduh"); +(^|" ")"king" changeCase(" kang"); +(^|" ")"library" changeCase(" liberry"); +(^|" ")"lie" changeCase(" lah"); +(^|" ")"life" changeCase(" lahf"); +(^|" ")"light" changeCase(" lot"); +(^|" ")"lighter" changeCase(" lahter"); +(^|" ")"like" changeCase(" lahk"); +(^|" ")"little" changeCase(" liddel"); +(^|" ")"log" changeCase(" lawg"); +(^|" ")"lot of" changeCase(" lottuh"); +(^|" ")"lots of" changeCase(" lotsa"); +(^|" ")"love" changeCase(" luv"); +(^|" ")"mall" changeCase(" mawl"); +(^|" ")"march" changeCase(" martch"); +(^|" ")"material" changeCase(" mahtearyul"); +(^|" ")"may" changeCase(" maey"); +(^|" ")"me " changeCase(" may "); +(^|" ")"mile" changeCase(" mahl"); +(^|" ")"minute" changeCase(" minent"); +(^|" ")"monday" changeCase(" mundy"); +(^|" ")"mosquito" changeCase(" skeeter"); +(^|" ")"moss" changeCase(" mawce"); +(^|" ")"mother" changeCase(" ma"); +(^|" ")"mroone" changeCase(" maroon"); +(^|" ")"my " changeCase(" mah "); +(^|" ")"myself" changeCase(" mahsef"); +(^|" ")"never" changeCase(" nevur"); +(^|" ")"nine" changeCase(" nahn"); +(^|" ")"nineteen" changeCase(" nontane"); +(^|" ")"nineth" changeCase(" nonth"); +(^|" ")"ninety" changeCase(" nondy"); +(^|" ")"no " changeCase(" naw "); +(^|" ")"nothing" changeCase(" nuthun"); +(^|" ")"november" changeCase(" noveyumbur"); +(^|" ")"ocean" changeCase(" oshun"); +(^|" ")"october" changeCase(" oktobur"); +(^|" ")"of " changeCase(" uh "); +(^|" ")"off" changeCase(" awf"); +(^|" ")"oil" changeCase(" all"); +(^|" ")"old " changeCase(" ode "); +(^|" ")"one of " changeCase(" wunna "); +(^|" ")"one " changeCase(" wun "); +(^|" ")"only" changeCase(" monly"); +(^|" ")"opposite" changeCase(" opsit"); +(^|" ")"orange" changeCase(" arnjuh"); +(^|" ")"over there" changeCase(" ovare"); +(^|" ")"over" changeCase(" ovur"); +(^|" ")"parking" changeCase(" parkin"); +(^|" ")"people" changeCase(" paypul"); +(^|" ")"picture" changeCase(" pitchur"); +(^|" ")"pillow" changeCase(" pillar"); +(^|" ")"pine" changeCase(" pahn"); +(^|" ")"pink" changeCase(" pank"); +(^|" ")"please" changeCase(" playze"); +(^|" ")"pretty" changeCase(" purdy"); +(^|" ")"probably" changeCase(" probly"); +(^|" ")"purple" changeCase(" burpel"); +(^|" ")"queen" changeCase(" kwane"); +(^|" ")"quit" changeCase(" kewyut"); +(^|" ")"rather" changeCase(" ruthur"); +(^|" ")"ready" changeCase(" reddy"); +(^|" ")"real" changeCase(" reeyul"); +(^|" ")"really" changeCase(" rilly"); +(^|" ")"red" changeCase(" rayud"); +(^|" ")"right" changeCase(" rot"); +(^|" ")"ring" changeCase(" rang"); +(^|" ")"said" changeCase(" sayud"); +(^|" ")"sale" changeCase(" sayul"); +(^|" ")"sale"|" sail"|" sell" changeCase(" sayul"); +(^|" ")"saturday" changeCase(" sadderdy"); +(^|" ")"school" changeCase(" skoo"); +(^|" ")"screen" changeCase(" skrane"); +(^|" ")"second" changeCase(" sekunt"); +(^|" ")"see" changeCase(" say"); +(^|" ")"september" changeCase(" ceptimbur"); +(^|" ")"seven" changeCase(" sebum"); +(^|" ")"seventeen" changeCase(" sebumtane"); +(^|" ")"seventh" changeCase(" sebumthd"); +(^|" ")"seventy" changeCase(" sebumdy"); +(^|" ")"she" changeCase(" shay"); +(^|" ")"shirt" changeCase(" churt"); +(^|" ")"sign" changeCase(" sahn"); +(^|" ")"silver" changeCase(" seeyulvur"); +(^|" ")"sit" changeCase(" set"); +(^|" ")"sixteen" changeCase(" sickstane"); +(^|" ")"sixth" changeCase(" sicksed"); +(^|" ")"sixty" changeCase(" sicksdy"); +(^|" ")"siz" changeCase(" sicks"); +(^|" ")"smell" changeCase(" smayul"); +(^|" ")"smile" changeCase(" smahl"); +(^|" ")"softer" changeCase(" sowftur"); +(^|" ")"some of those" changeCase(" sumoze"); +(^|" ")"some" changeCase(" sum"); +(^|" ")"something" changeCase(" sumpn"); +(^|" ")"sometime" changeCase(" sumtom"); +(^|" ")"south" changeCase(" saowth"); +(^|" ")"speak" changeCase(" spake"); +(^|" ")"spring" changeCase(" sprang"); +(^|" ")"sprinkle" changeCase(" sprankul"); +(^|" ")"stadium" changeCase(" stadyum"); +(^|" ")"station" changeCase(" stayshun"); +(^|" ")"string" changeCase(" strang"); +(^|" ")"sunday" changeCase(" sundy"); +(^|" ")"sure" changeCase(" shore"); +(^|" ")"tale"|" tail" changeCase(" tayul"); +(^|" ")"talk" changeCase(" tawk"); +(^|" ")"talking" changeCase(" tawkin"); +(^|" ")"tall" changeCase(" tahl"); +(^|" ")"tan" changeCase(" tayun"); +(^|" ")"ten" changeCase(" teyun"); +(^|" ")"tenth" changeCase(" teyunth"); +(^|" ")"terible" changeCase(" tarbul"); +(^|" ")"terrible" changeCase(" tarbul"); +(^|" ")"that is"|" that's" changeCase(" thets"); +(^|" ")"that" changeCase(" thet"); +(^|" ")"the only" changeCase(" thonly"); +(^|" ")"the other" changeCase(" thuther"); +(^|" ")"the" changeCase(" thuh"); +(^|" ")"their" changeCase(" thur"); +(^|" ")"there" changeCase(" thare"); +(^|" ")"there" changeCase(" thayure"); +(^|" ")"they" changeCase(" thay"); +(^|" ")"thing" changeCase(" thang"); +(^|" ")"think" changeCase(" thank"); +(^|" ")"third" changeCase(" thurd"); +(^|" ")"thirteen" changeCase(" thurtane"); +(^|" ")"thirty" changeCase(" thurdy"); +(^|" ")"this" changeCase(" thus"); +(^|" ")"those" changeCase(" them"); +(^|" ")"thousand" changeCase(" thousun"); +(^|" ")"three" changeCase(" thray"); +(^|" ")"through" changeCase(" thoo"); +(^|" ")"throw" changeCase(" thow"); +(^|" ")"throw" changeCase(" throw"); +(^|" ")"thrown" changeCase(" thowed"); +(^|" ")"thursday" changeCase(" thursdy"); +(^|" ")"tie" changeCase(" tah"); +(^|" ")"tied" changeCase(" tahd"); +(^|" ")"tight" changeCase(" tot"); +(^|" ")"time" changeCase(" tom"); +(^|" ")"to " changeCase(" tuh "); +(^|" ")"today" changeCase(" tuhday"); +(^|" ")"toilet" changeCase(" outhouse"); +(^|" ")"told" changeCase(" tode"); +(^|" ")"tommorrow" changeCase(" tuhmorrow"); +(^|" ")"tree" changeCase(" tray"); +(^|" ")"truck" changeCase(" truk"); +(^|" ")"tuesday" changeCase(" chewsdy"); +(^|" ")"twelve" changeCase(" twayulv"); +(^|" ")"twenty" changeCase(" twindy"); +(^|" ")"two " changeCase(" tew "); +(^|" ")"understand" changeCase(" understaynd"); +(^|" ")"used to" changeCase(" ustuh"); +(^|" ")"vehicle" changeCase(" vee-hicul"); +(^|" ")"victory" changeCase(" viktray"); +(^|" ")"violation" changeCase(" vahlayshun"); +(^|" ")"virtual" changeCase(" vurchul"); +(^|" ")"want to " changeCase(" wonna "); +(^|" ")"was that" changeCase(" wuzzat"); +(^|" ")"was" changeCase(" wuz"); +(^|" ")"wash" changeCase(" wartch"); +(^|" ")"water" changeCase(" warder"); +(^|" ")"we " changeCase(" way "); +(^|" ")"wedding" changeCase(" wedden"); +(^|" ")"wednesday" changeCase(" winsdy"); +(^|" ")"well" changeCase(" wayul"); +(^|" ")"were " changeCase(" wuz "); +(^|" ")"west " changeCase(" wayust "); +(^|" ")"what did you" changeCase(" whudja"); +(^|" ")"what did" changeCase(" whuddle"); +(^|" ")"what do you" changeCase(" wadja"); +(^|" ")"what is the matter" changeCase(" smatter"); +(^|" ")"what is"|" what's" changeCase(" whut"); +(^|" ")"what" changeCase(" whut"); +(^|" ")"wheel" changeCase(" whale"); +(^|" ")"when" changeCase(" wheyun"); +(^|" ")"where did you" changeCase(" whardja"); +(^|" ")"where" changeCase(" whar"); +(^|" ")"where" changeCase(" whayer"); +(^|" ")"white" changeCase(" wot"); +(^|" ")"why don't you" changeCase(" y-oncha"); +(^|" ")"why" changeCase(" wha"); +(^|" ")"wife" changeCase(" waf"); +(^|" ")"window" changeCase(" wender"); +(^|" ")"winter" changeCase(" winner"); +(^|" ")"wire" changeCase(" war"); +(^|" ")"with you" changeCase(" witchew"); +(^|" ")"woman" changeCase(" whoamun"); +(^|" ")"women" changeCase(" wimmen"); +(^|" ")"world" changeCase(" warld"); +(^|" ")"worse than" changeCase(" worsun"); +(^|" ")"yard" changeCase(" chard"); +(^|" ")"yellow" changeCase(" yuller"); +(^|" ")"yes" changeCase(" u-betcha"); +(^|" ")"yes" changeCase(" yayus"); +(^|" ")"you " changeCase(" yawl "); +(^|" ")"your are"|" you're" changeCase(" yore"); +(^|" ")"your" changeCase(" chur"); +.|'\n' ECHO; +%% +main() +{ + yylex(); +} + +void changeCase(word) +char *word; +{ +extern char *yytext; + +/* change o/p to upper/lower based on original text */ + if (isupper(*(yytext+1)) && islower(*(word+1))) + *(word+1) = toupper(*(word+1)); + + printf(word); +} diff --git a/eleet b/eleet new file mode 100755 index 0000000..017d9eb --- /dev/null +++ b/eleet @@ -0,0 +1,13 @@ +#!/usr/bin/perl -p +# Eleet filter, Copyright 1999 by Joey Hess under the terms of the GNU GPL. +BEGIN { + $transstring="4bcd3fgh1jklmn0pqr5+uvwxyz"; + $t="tr/a-zA-Z/$transstring".uc($transstring)."/"; +} +eval $t; +s:h:|-|:ig; +s:l:|_:ig; +s:m:/\\/\\:ig; +s:n:/\\/:ig; +s:v:\\/:ig; +s:x:><:ig; diff --git a/eleet.l b/eleet.l new file mode 100644 index 0000000..3cd77f1 --- /dev/null +++ b/eleet.l @@ -0,0 +1,48 @@ +%e 2000 +%p 5000 +%n 1000 +%k 500 +%a 4000 +%o 2000 +BW [ ] +EW [ .,;!?] + +%{ +#include + +char buf[128]; +%} + +%% + +a printf("4"); +A printf("4"); +e printf("3"); +E printf("3"); +i printf("1"); +I printf("1"); +o printf("0"); +O printf("0"); +n printf("/\\/"); +N printf("/\\/"); +m printf("/\\/\\"); +M printf("/\\/\\"); +v printf("\\/"); +V printf("\\/"); +t printf("+"); +T printf("+"); +s printf("5"); +S printf("5"); +l printf("|_"); +L printf("|_"); +x printf("><"); +X printf("><"); +h printf("|-|"); +H printf("|-|"); + +%% +main() +{ + yylex(); + return(0); +} diff --git a/filters.6 b/filters.6 new file mode 100644 index 0000000..4ee6a72 --- /dev/null +++ b/filters.6 @@ -0,0 +1,56 @@ +.TH FILTERS 6 +.SH NAME +aust, b1ff, biffa, buck, censor, chef, cockney, drawl, fin, fudd, jethro jive ken, kraut, ky00te, mb, moo, newspeak, nyc, valspeak \- assorted text filters +.SH SYNOPSIS +All the filters read input from stdin, change it, and write the filtered +text to stdout. +.SH "DESCRIPTION" +All of these programs are filters to do all sorts of strange things to text. +No racial or societal slurs are intended. For amusement only. +.IP aust +Australian +.IP b1ff +The B1FF filter +.IP biffa +?? +.IP buck +The buckwheat filter +.IP censor +[CENSORED] +.IP chef +convert English on stdin to Mock Swedish on stdout +.IP cockney +Cockney English +.IP drawl +English to Texan translator +.IP fin +?? +.IP fudd +Elmer Fudd +.IP jethro +Hillbilly text filter +.IP jive +Jive English +.IP ken +English into Cockney, featuring (dubious) rhyming +slang for a lot of computer terminology. +.IP kraut +German +.IP mb +Marc Barrett posting translator +.IP moo +The cow filter +.IP newspeak +As in 1984 +.IP nyc +Brooklyn English +.IP valspeak +?? +.IP ky00te +This program places a very cute (and familiar to FurryMuck +fans) accent to any text file. +.SH "SEE ALSO" +.IP /usr/doc/filters/SAMPLES +Lists samples of the output of all the filters. +.SH AUTHOR +The filters were collected from all over, by Joey Hess diff --git a/fin.l b/fin.l new file mode 100644 index 0000000..68f266e --- /dev/null +++ b/fin.l @@ -0,0 +1,63 @@ + +T [" .!?,"]* +%% + +look printf("watch"); +watch printf("look"); +hear printf("listen"); +listen printf("hear"); +good printf("well"); +well printf("good"); +say printf("speaks"); +said printf("speaked"); +being printf("be"); +ck printf("kk"); +nn printf("n"); +mm printf("m"); +tt printf("t"); +ss printf("s"); +dd printf("d"); +" had " printf(" have "); +" than " printf(" to "); +" was " printf(" were "); +" can " printf(" be able to "); +" do " printf(" doing "); +" does " printf(" doings "); +" see " printf(" be seeing "); +" be " printf(" being "); +" am " printf(" do be "); +" as " printf(" so "); +" so " printf(" as "); +" is " printf(" does be "); +" my " printf(" the of me "); +"My " printf("The of me "); +" his " printf(" the of him "); +"His " printf("The of him "); +[Yy]our printf("the of you"); +" a " printf(" "); +" the " printf(" "); +"A " printf("One "); +"ts " printf("t's "); +"t's " printf("ts "); +[Tt]hat printf("this"); +[Tt]his printf("that"); +into printf("in"); +" in " printf(" into "); +onto printf("on"); +" on " printf(" onto "); +never printf("not once"); +[Oo]nce printf("one time"); +[Tt]wice printf("two times"); +about printf("by"); +[Ww]hy printf("how"); +" by " printf(" from "); +" to " printf(" for "); +" for " printf(" to "); +"ing " printf("ed "); +%% + +main() +{ + srand(getpid()); + yylex(); +} diff --git a/fudd.l b/fudd.l new file mode 100644 index 0000000..463c214 --- /dev/null +++ b/fudd.l @@ -0,0 +1,37 @@ +%e 2000 +%p 5000 +%n 1000 +%k 500 +%a 4000 +%o 2000 +BW [ ] +EW [ .,;!?] + +%{ +#include + +char buf[128]; +%} + +%% +"r" printf("w"); +"l" printf("w"); +"qu" printf("qw"); +"th " printf("f "); +"th" printf("d"); +"n." printf("n, uh-hah-hah-hah\. "); +"R" printf("W"); +"L" printf("W"); +"Qu" printf("Qw"); +"QU" printf("QW"); +"TH " printf("F "); +"TH" printf("D"); +"Th" printf("D"); +"N." printf("N, uh-hah-hah-hah\. "); + +%% +main() +{ + yylex(); + return(0); +} diff --git a/jethro.l b/jethro.l new file mode 100644 index 0000000..1ea0f79 --- /dev/null +++ b/jethro.l @@ -0,0 +1,273 @@ + + /* jethro.l */ +%e 7000 +%k 5000 +%p 9000 +%n 2000 +%a 9000 +%o 7000 + +SW [\n \"(] +EW [\n ".",\"!?):;] +BW [\n ] + +%{ + /* + ** jethro v. 1.00 06/10/93 + ** Duane Paulson "dap" + ** Hillbilly text filter. Compile with lex, then C. + ** syntax will be: + ** jethro output_file. + ** Public domain. Use at your own risk. Y'all come back now, heah? + */ + /************************************************************************* + REVISION LOG + when ver who change + -------- ---- --- ----------------------------------------------------- + 06/10/93 1.00 dap Initial release. + 8.May.94 1.10 beg Fixed for HP-UX + *************************************************************************/ + +#define PUTLAST unput(*(yytext+strlen(yytext)-1)); +#define SUB(A) fprintf(yyout, "%c%s", *A|(*yytext&32), A+1); +#define SSUB(A) fprintf(yyout, "%c%c%s", *yytext, *A|(*(yytext+1)&32), A+1); +#define SESUB(A) fprintf(yyout, "%c%c%s", *yytext, *A|(*(yytext+1)&32), A+1); PUTLAST; +#define ESUB(A) fprintf(yyout, "%c%s", *A|(*yytext&32), A+1); PUTLAST; + +#include + +char WhAt[]="@(#)Duane Paulson's hillbilly text filter. (jethro)\n@(#)$Header: jethro.l,v 1.1 94/05/08 23:41:58 bgriffin Final $" +; + +%} + +%% + +{SW}[Gg]reetings{EW} | +{SW}[Hh]i{EW} | +{SW}[Hh]ello{EW} SESUB("Howdy"); +{SW}[Bb]ye{EW} | +{SW}[Gg]oodbye{EW} SESUB("Y'all come back now, heah?"); +{SW}[Hh]ear{EW} SESUB("Heah"); +{SW}[Cc]ar{EW} | +{SW}[Aa]uto{EW} | +{SW}[Rr]elax{EW} SESUB("Set a spell -- put yore feet up"); +{SW}[Aa]utomobile{EW} SESUB("Gasoline buggy"); +[Ss]wimming{BW}pool SUB("Cement pond"); +[Pp]ool{BW}table SUB("Fancy eatin table"); +[Pp]ool{BW}cue | +[Cc]ue{BW}stick SUB("Fancy pot passer"); +{SW}[Bb][r]?oil{EW} | +{SW}[Bb]ake{EW} | +{SW}[Ff]ry{EW} | +{SW}[Ss]aute{EW} | +{SW}[Cc]ook{EW} SESUB("Whomp up"); +{SW}[Bb][r]?oiling{EW} | +{SW}[Bb]akeing{EW} | +{SW}[Ff]rying{EW} | +{SW}[Ss]auteing{EW} | +{SW}[Cc]ooking{EW} SESUB("Whompin up"); +{SW}[Bb][r]?oiled{EW} | +{SW}[Bb]aked{EW} | +{SW}[Ff]ryed{EW} | +{SW}[Ss]auted{EW} | +{SW}[Cc]ooked{EW} SESUB("Done whomped up"); +{SW}[Bb][r]?oils{EW} | +{SW}[Bb]akes{EW} | +{SW}[Ff]rys{EW} | +{SW}[Ss]autes{EW} | +{SW}[Cc]ooks{EW} SESUB("Whomps up"); +{SW}[Gg]roceries{EW} | +{SW}[Ff]ood{EW} SESUB("Vittles"); +[Ss]alad SUB("Slaw"); +[Vv]egetable SUB("Green"); +[Pp]otato SUB("Tater"); +{SW}[Tt]omato SSUB("Tuhmater"); +{SW}[Rr]hubarb{EW} SESUB("Pie plant"); +{SW}[Ll]iquor{EW} | +{SW}[Ww]hisk[e]?y{EW} | +{SW}[Ss]cotch{EW} | +{SW}[Bb]ourbon{EW} | +{SW}[Gg]in{EW} | +{SW}[Vv]odka{EW} | +{SW}[Tt]equila{EW} | +{SW}[Ll]iqueur{EW} SESUB("Rheumatiz medcin"); +{SW}[Bb]ooze{EW} SESUB("Corn likker"); +{SW}[Cc]ocktail{EW} | +{SW}[Mm]ixed{BW}drink{EW} SESUB("Waste of good likker"); +{SW}[Bb]ar{EW} SESUB("Dance hall"); +{SW}[Bb]ars{EW} SESUB("Dance halls"); +{SW}[Ss]aloon | +{SW}[Cc]ocktail{BW}lounge SESUB("Dance hall"); +{SW}[Ww]hore | +{SW}[Pp]rostitute | +{SW}[Ss]lut SSUB("Dance hall girl"); +{SW}[Ss]ecret{BW}agent{EW} | +{SW}[Ss]py{EW} | +{SW}007{EW} SESUB("Double nought spy"); +{SW}[Zz]ero{EW} SESUB("Nought"); +{SW}[Pp]ants{EW} SESUB("Trousers"); +{SW}[Jj]eans{EW} | +{SW}[Dd]ungarees{EW} | +{SW}[Ll]evi[']?s{EW} SESUB("Overhalls"); +{SW}[Ss]hoe SSUB("High-button shoe"); +{SW}[Jj]acket SSUB("Coat"); +{SW}[Ss]hotgun SSUB("Fowlin piece"); +{SW}[Rr]evolver | +{SW}[Gg]un SSUB("Shootin iron"); +{SW}[Rr]ifle SSUB("Ozark longrifle"); +{SW}[Ll]ibrar[yi] SSUB("Liberry"); +[Ww]ash SUB("Warsh"); +[Ff]amily SUB("Fambly"); +[Ff]ry{BW}pan | +[Ff]rying{BW}pan | +[Ss]aute{BW}pan SUB("Skillet"); +{SW}[Aa]nimal SSUB("Critter"); +{SW}FBI{EW} | +{SW}F.B.I.{EW} | +{SW}CIA{EW} | +{SW}C.I.A.{EW} | +{SW}ATF{EW} | +{SW}A.T.F.{EW} | +{SW}IRS{EW} | +{SW}I.R.S.{EW} | +{SW}SS{EW} | +{SW}S.S.{EW} | +{SW}[Ss]elective{BW}[Ss]ervice{EW} | +{SW}[Ss]elective{BW}[Ss]ervice{BW}[Ss]ystem{EW} | +{SW}[Ss]ecret{BW}[Ss]ervice{EW} SESUB("Revanooers"); +{SW}[Pp]olice | +{SW}[Pp]oliceman | +{SW}[Ss]heriff | +{SW}[Dd]eputy | +{SW}[Dd]eputy{BW}[Ss]heriff | +{SW}[Mm]arshall | +{SW}[Dd]eputy{BW}[Mm]arshall | +{SW}[Pp]ark{BW}[Rr]anger | +{SW}[Tt]exas{BW}[Rr]anger | +{SW}[Hh]ighway{BW}[Pp]atrol SSUB("Constable"); + +{SW}[Mm]other | +{SW}[Mm][ao]mm[ay]? | +{SW}[Mm]ommie | +{SW}[Mm]om SSUB("Maw"); +{SW}[Mm]a{EW} SESUB("Maw"); +{SW}[Ff]ather SSUB("Paw"); +{SW}[Dd]ad{EW} | +{SW}[Dd]addy | +{SW}[Pp]a{EW} | +{SW}[Pp][ao]p{EW} | +{SW}[Pp][ao]pp[ay]?{EW} SESUB("Paw"); +{SW}[Gg]randmother{EW} | +{SW}[Gg]randma[w]?{EW} SESUB("Granny"); +{SW}[Gg]randfather{EW} | +{SW}[Gg]ran[d]{1,2}ad[d]?[y]?{EW} | +{SW}[Gg]randpop{EW} | +{SW}[Gg]randpa[w]?{EW} SESUB("Grampy"); +{SW}[Mm]y{EW} SESUB("Mah"); +{SW}them{EW} SESUB("em"); +[Dd]og SUB("Dawg"); +[Ll]awyer | +[Ll]egal{BW}counc[ei]l | +[Ll]egal{BW}councellor | +[Aa]ttorney | +[Aa]ttorney{BW}[Aa]t{BW}[Ll]aw SUB("City slicker"); + +{SW}[Tt]han{EW} SESUB("Then"); +[Cc]haracterize SUB("Show"); +{SW}[Vv]ery{EW} | +{SW}[Ee]xtremely{EW} | +{SW}[Rr]eally{EW} | +{SW}[Rr]eal{EW} SESUB("Right"); +{SW}[Hh]aven't{EW} | +{SW}[Ii]sn't{EW} | +{SW}[Aa]ren't{EW} SESUB("Aint"); +{SW}[Ss]aid{EW} | +{SW}[Ss]ays{EW} SESUB("Sez"); +{SW}[Aa]re{EW} SESUB("Is"); +{SW}[Ss]hould{EW} SESUB("Ortta"); +{SW}[Pp]erhaps{EW} | +{SW}[Mm]aybe{EW} SESUB("Mebbe"); +{SW}[Ss]ick{EW} SESUB("Ailin'"); +{SW}I'm{BW}not{EW} SESUB("I aint"); +{SW}[Ss]cared{EW} SESUB("A-skeert"); +{SW}[Ss]care SSUB("Skeer"); +{SW}[Hh]ave{EW} SESUB("Got"); +{SW}[Pp]ossess{EW} SESUB("Have"); +{SW}[Hh]elp SSUB("Hep"); +{SW}[Tt]ired{EW} SESUB("Tuckered out"); +{SW}[Cc]ompletely{EW} SESUB("Plumb"); +{SW}[Dd]runk{EW} SESUB("A mite woozy"); + +{SW}[Yy]es{EW} SESUB("Yep"); +{SW}[Nn]o{EW} SESUB("Nope"); + +{SW}[Ii]t{BW}is{EW} SESUB("Tis"); +{SW}[Aa]t{BW}all{EW} *(yytext+1)=(char)'A'; SESUB("A tall"); + +{SW}[Aa]m{EW} | +{SW}[Aa]re{EW} SESUB("Is"); +{SW}[Ww]as{EW} | +{SW}[Ww]ere{EW} SESUB("Wuz"); +{SW}[Ww]asn't{EW} SESUB("Wasunt"); +[Ee]very SUB("Ever"); +{SW}[Ww]ant/s SSUB("Is after"); +{SW}[Ww]anted{EW} SESUB("Was after"); +{SW}[Ww]anting{EW} SESUB("Hankering after"); +{SW}[Dd]oesn't{EW} | +{SW}[Dd]on't{EW} SESUB("Dasent"); +{SW}[Yy]ou'll{EW} SESUB("Y'all will"); +{SW}[Yy]our SSUB("Yore"); +{SW}[Mm]ore{EW} SESUB("Mo"); +tial SUB("shul"); +cious SUB("shus"); +ious SUB("yus"); +tion SUB("shun"); +{SW}[Cc]an{EW} SESUB("C'n"); +{SW}[Yy]ou{EW} SESUB("Y'all"); +{SW}[Ff]or{EW} SESUB("Fer"); +{SW}[Tt]he{EW} SESUB("Duh"); +ing SUB("in"); +{SW}[Tt]oo{EW} SESUB("Besides"); +{SW}[Tt]o{EW} SESUB("Tuh"); +{SW}[Aa][n]?{EW} SESUB("Ah"); +{SW}[Aa]re{EW} | +{SW}[Oo]ur{EW} | +{SW}[Oo]r{EW} SESUB("Ore"); +{SW}[Oo]f{EW} SESUB("Uv"); +{SW}I{EW} SESUB("Ah"); +{SW}I'm{EW} SESUB("Ahm a"); +{SW}I'll{EW} SESUB("Ahl"); +{SW}I'd{EW} SESUB("Ah wood"); +'nt *(yytext)=(char)'u'; SUB("unt"); +'re SUB(" is"); +'ve SUB(" done"); +eed{EW} ECHO; +ed{EW} ESUB("d"); +{SW}[Oo]wn{EW} | +{SW}[Tt]own{EW} | +{SW}[Dd]own{EW} | +{SW}[Gg]own{EW} | +{SW}[Bb]rown{EW} ECHO; +wn{EW} ESUB("ed"); +{SW}[Bb]elow{EW} | +{SW}[Kk]now{EW} | +{SW}[Tt]hrow{EW} | +{SW}[Gg]row{EW} | +{SW}[Hh]ow{EW} | +{SW}[Nn]ow{EW} | +{SW}[Bb]row{EW} | +{SW}[Ss]how{EW} ECHO; +ow{EW} ESUB("er"); +re{EW} | +er{EW} ESUB("uh"); +{SW}[Hh]er{EW} ECHO; +! SUB(". Ye DAWGies!!!"); + +%% + +main() +{ + yylex(); +} + diff --git a/jibberish b/jibberish new file mode 100644 index 0000000..ad2743a --- /dev/null +++ b/jibberish @@ -0,0 +1,53 @@ +#!/usr/bin/perl +# jibberish -- run all filters in random order + +$ENV{PATH}.=":/usr/games"; + +@all= qw( +jive +valspeak +nyc +cockney +fin +biffa +ken +aust +drawl +kraut +newspeak +chef +marc-barrett +censor +fudd +moo +buck +jethro +b1ff +eleet +ky00te +); + +# shuffle order +srand; +for (0..$#all) { + my $n= @all*rand; + my $was= $all[$_]; + $all[$_]= $all[$n]; + $all[$n]= $was; +} + +# start the pipe... +my $pipe= join '|', @all; +open FILTER, "$pipe|" + or die ""Never mind...\n";; + +# display the results +while () { + print $_ +} + +# This could be optimized: take the last program off the pipeline, +# open the pipeline as standard input, then exec that last program. +# +# But you have to ask yourself: how important is it to optimize +# the generation of jibberish? diff --git a/jive.l b/jive.l new file mode 100644 index 0000000..dcb9924 --- /dev/null +++ b/jive.l @@ -0,0 +1,250 @@ +%{ +/* + * Lex filter to transform plain English into Jive English. + * No racial or societal slurs are intended. For amusement only. + * + * Copyright 1986 by Daniel Klein and Clement Cole. + * + * Reproduction permitted so long as this notice is retained. + */ +%} +%e 1700 +%p 4000 +%n 700 +%k 450 +%a 1700 +%o 1500 +BW [ \t\(] +EW [ \t.,;!\?$\)] +%% +@[Bb]egin(.*) | +".so ".*$ printf("%s", yytext); +{BW}send printf("%ct'row",yytext[0]); +program+ printf("honky code"); +[Uu]nix printf("slow mo-fo"); +UNIX printf("dat slow mo-fo"); +actual printf("ak'shul"); +{BW}take printf("%csnatch",yytext[0]); +{BW}took | +{BW}take[ns] printf("%csnatch'd",yytext[0]); +[Mm]exican printf("%cet-back", caseify('w')); +[Ii]talian printf("%creaser", caseify('g')); +{BW}big{EW} { printf("%cbig ass",yytext[0]);plastc();} +fool printf("honkyfool"); +modem printf("doodad"); +{BW}he{EW} { printf("%cmah' man he",yytext[0]);plastc();} +"e the"{EW} | +"a the"{EW} | +"t the"{EW} | +"d the"{EW} { printf("%c da damn", yytext[0]);plastc();} +wife | +woman printf("mama"); +girl printf("goat"); +something printf("sump'n"); +{BW}lie printf("%chonky jive",yytext[0]); +-o- printf("-on rebound-"); +[a-z]"." { printf("%s", yytext);expletive();} +! printf(". Right On!"); +[Ss]ure printf("%cho'", yytext[0]); +get printf("git"); +"will have"{EW} | +"will"{EW} | +"got to"{EW} { printf("gots'ta");plastc();} +"I am" printf("I's gots'ta be"); +"aren't" | +"am not" | +"have not" | +"is not" | +"are not" printf("ain't"); +{BW}see{EW} { printf("%csee's",yytext[0]);plastc();} +{BW}are{EW} { printf("%cis",yytext[0]);plastc();} +{BW}hat{EW} { printf("%cfedora",yytext[0]);plastc();} +{BW}shoe printf("%ckicker",yytext[0]); +{BW}"have to"{EW} | +{BW}has{EW} { printf("%cgots'ta",yytext[0]);plastc();} +have printf("gots'"); +{BW}go{EW} | +{BW}"come over"{EW} | +{BW}come{EW} { printf("%cmosey on down",yytext[0]);plastc();} +buy printf("steal"); +{BW}car{EW} { printf("%cwheels",yytext[0]);plastc();} +drive printf("roll"); +{BW}food printf("%ccatfish an' colluhd greens",yytext[0]); +{BW}eat{EW} { printf("%cfeed da bud",yytext[0]);plastc();} +drink printf("guzzle"); +black | +negro printf("brother"); +white printf("honky"); +nigger printf("gentleman"); +nice printf("supa' fine"); +{BW}person printf("%csucka'",yytext[0]); +[Pp]eople printf("%cucka's", caseify('s')); +{BW}thing thing(yytext[0]); +house{EW} { printf("crib");plastc();} +home printf("plantation"); +name printf("dojigger"); +{BW}path printf("%calley",yytext[0]); +[Cc]omputer printf("%clunker", yytext[0]); +or printf("o'"); +president printf("super-dude"); +"prime minister" printf("prahm mistah"); +government printf("guv'ment"); +knew printf("knowed"); +[Bb]ecause printf("'%cuz", caseify('c')); +[Yy]our printf("%co'", yytext[0]); +[Ff]our printf("%coe", yytext[0]); +got printf("gots"); +young printf("yung"); +you printf("ya'"); +You printf("You's"); +first printf("fust"); +police printf("honky pigs"); +{BW}string printf("%cchittlin'",yytext[0]); +{BW}read printf("%ceyeball",yytext[0]); +write printf("scribble"); +think{EW} { printf("thin'");plastc();} +with printf("wif"); +other printf("uthu'"); +[Tt]hr printf("%c'r", yytext[0]); +[Tt]h printf("%c", caseify('d')); +ing printf("in'"); +{BW}a{EW} { printf("%csome",yytext[0]);plastc();} +{BW}to{EW} { printf("%ct'",yytext[0]); + if(yytext[yyleng-1]!=' ') + plastc(); + } +tion printf("shun"); +[Aa]lmost printf("%cos'", caseify('m')); +from printf("fum"); +[Yy]"ou're" printf("%couse", yytext[0]); +alright | +okay printf("coo'"); +[Aa]nd printf("%cn'", yytext[0]); +known printf("knode"); +want printf("wants'"); +beat printf("whup'ed"); +ile printf("ah'l"); +er{EW} { printf("uh");plastc();} +[a-z]sti printf("%cs'i", yytext[0]); +tute printf("toot"); +exp printf("'sp"); +exs | +exc printf("'s"); +{BW}ex printf("%c'es",yytext[0]); +[ae]ct{EW} { printf("%cc'", yytext[0]); plastc(); } +like printf("likes"); +done | +did printf("dun did"); +"kind of" printf("kind'a"); +women printf("honky chicks"); +{BW}man{EW} { printf("%cdude",yytext[0]);plastc();} +{BW}men{EW} | +{BW}mens{EW} { printf("%cdudes",yytext[0]);plastc();} +injured printf("hosed"); +killed | +dead printf("wasted"); +good printf("baaaad"); +open{EW} { printf("jimmey");plastc();} +opened{EW} { printf("jimmey'd");plastc();} +{BW}very printf("%creal",yytext[0]); +per printf("puh'"); +oar printf("o'"); +{BW}can printf("%ckin",yytext[0]); +{BW}just{EW} { printf("%cplum",yytext[0]);plastc();} +[Dd]etroit printf("Mo-town"); +[Ww]"estern "[Ee]"lectric" printf("da' cave"); +{BW}believe printf("%crecon'",yytext[0]); +[Ii]"ndianapolis" printf("Nap-town"); +Daniel | +Dan printf("Liva' Lips"); +Reagan printf("Kingfish"); +Ronald{EW} | +Ron{EW} { printf("Rolo");plastc();} +John printf("Rastus"); +Jim printf("Bo-Jangles"); +pontiff | +pope printf("wiz'"); +[Pp]ravda printf("dat commie rag"); +broken printf("bugger'd"); +strange{EW} { printf("funky");plastc();} +dance{EW} { printf("boogy");plastc();} +ask printf("ax'"); +{BW}so{EW} { printf("%cso's",yytext[0]);plastc();} +heard printf("'hoid"); +head printf("'haid"); +boss printf("main man"); +money printf("bre'd"); +[a-z]":" { *(yytext+1) = ','; + printf("%s dig dis:",yytext); + } +amateur printf("begina'"); +radio printf("transista'"); +{BW}of{EW} { printf("%cuh",yytext[0]);plastc();} +which | +what printf("whut"); +"don't" printf("doan'"); +does printf("duz"); +{BW}was{EW} | +{BW}were{EW} { printf("%cwuz",yytext[0]);plastc();} +{BW}understand printf("%cdig",yytext[0]); +{BW}my printf("%cmah'",yytext[0]); +again | +against printf("agin'"); +{BW}[Ii]{EW} { printf("%cah'",yytext[0]);plastc();} +meta printf("meta-fuckin'"); +cally printf("c'l"); +%% +plastc() +{ + unput(yytext[yyleng-1]); +} + +caseify(c) +char c; +{ + if (yytext[0] <= 'Z') + return (c - ' '); + else + return (c); +} + +thing(c) +char c; +{ + static short count = 0; + + putchar(c); + switch (count++ % 4) { + case 0: case 2: + printf("thang"); + break; + case 1: + printf("doohickey"); + break; + case 3: + printf("wahtahmellun"); + break; + } +} +expletive() +{ + static short count = 0; + static short which = 0; + + if (count++ % 4 == 0) { + switch (which++ % 5) { + case 0: printf(" What it is, Mama!"); break; + case 1: printf(" Ya' know?"); break; + case 2: printf(" Sheeeiit."); break; + case 3: printf(" Ya' dig?"); break; + case 4: printf(" Git down!"); break; + } + } +} + +/* + * Bugs: + * + * If a sentence starts with a keyword it doan' get converted, or: + * it do, but gets a leading space + */ diff --git a/ken.l b/ken.l new file mode 100644 index 0000000..6e03181 --- /dev/null +++ b/ken.l @@ -0,0 +1,283 @@ +%{ +/* + * ken: + * will turn English into Cockney, featuring (dubious) rhyming slang for a lot + * of computer terminology. + * + * Written by Stephen K Mulrine + * Make copies if you want etc.etc. + * + * ken is named after Ken the Chirpy Cockney Character from the Viz Comic (tm), + * who speaks somewhat like that. + */ +%} +%e 3000 +%p 6000 +%n 1000 +%k 500 +%a 4000 +%o 2000 +BW [ ] +EW [ .,;!?] +%{ + char buf[128]; +%} + +%% + +stairs printf("apples and pears"); +Downstairs printf("Down the apples and pears"); +downstairs printf("down the apples and pears"); +Upstairs printf("Up the apples and pears"); +upstairs printf("up the apples and pears"); +[Mm]outh printf("North and South"); +[Ff]ace printf("Boat Race"); +[Tt]rouble printf("Barney Rubble"); +wife { switch(rand()%2) + { + case 0: printf("trouble and strife"); break; + case 1: printf("ole lady"); break; + } + } +Road printf("Frog and Toad"); +" road" printf(" frog and toad"); +"pub " printf("rub-a-dub "); +" bar " printf(" boozer "); +" husband" printf(" ole man"); +Party printf("Knees-up"); +party printf("knees-up"); +Parties printf("Knees-ups"); +parties printf("knees-ups"); +My printf("Me"); +" my" printf(" me"); +Your printf("Yer"); +your printf("yer"); +"You are " printf("Yer "); +"you are " printf("yer "); +You printf("Yer"); +you printf("yer"); +Those printf("Them"); +those printf("them"); +" those" printf(" them"); +"(those" printf("(them"); +"The " { switch(rand()%5) + { + case 0: printf("The bleedin' "); break; + default: ECHO; break; + } + } +"The" ECHO; +" the " { switch(rand()%5) + { + case 0: printf(" the bleedin' "); break; + default: ECHO; break; + } + } +[" "(]the ECHO; +"the " { switch(rand()%5) + { + case 0: printf(" the bleedin' "); break; + default: ECHO; break; + } + } +[Tt]his ECHO; +[" "(]this ECHO; +[Tt]hat ECHO; +[" "(]that ECHO; +Thus printf("So"); +" thus" printf(" so"); +"(thus" printf("(so"); +"thus" printf("so"); +[Tt]han ECHO; +[" "(]than ECHO; +Who ECHO; +who ECHO; +" old " printf(" ole "); +" to " printf(" ter "); +"Aren't you " printf("Aintcha "); +"aren't you " printf("aintcha "); +"Aren't" printf("Ain't"); +"aren't" printf("ain't"); +"Isn't" printf("Ain't"); +"isn't" printf("ain't"); +"Are not " printf("Ain't"); +"are not " printf("ain't "); +"Is not " printf("Ain't "); +" is not " printf(" ain't "); +"What is th" printf("Woss"); +"what is th" printf("woss"); +"What are you " printf("Wotcher "); +"what are you " printf("wotcher "); +"What you are" printf("Wotcher"); +"what you are" printf("wotcher"); +"What you're" printf("Wotcher"); +"what you're" printf("wotcher"); +"What are your" printf("Wotcher"); +"what are your" printf("wotcher"); +"What do you " printf("Wotcher "); +"what do you " printf("wotcher "); +"What do your" printf("Wotcher"); +"what do your" printf("wotcher"); +" "H[aeu]llo printf(" Wotcher"); +" "h[aeu]llo printf(" wotcher"); +What printf("Wot"); +what printf("wot"); +Were printf("Was"); +were printf("was"); +Bother printf("Ars"); +bother printf("ars"); +Mother printf("Muvver"); +Other printf("Uvver"); +other printf("uvver"); +Father printf("Favver"); +father printf("favver"); +Rather printf("Ravver"); +rather printf("ravver"); +Weather printf("Wevver"); +weather printf("wevver"); +Leather printf("Levver"); +leather printf("levver"); +Wither printf("Wivver"); +wither printf("wivver"); +Either printf("Eever"); +either printf("eever"); +With printf("Wiv"); +with printf("wiv"); +Anything printf("Anyfink"); +anything printf("anyfink"); +Something printf("Sumfink"); +something printf("sumfink"); +Nothing printf("Nuffink"); +nothing printf("nuffink"); +guitars printf("spoons"); +guitar printf("spoons"); +drums printf("spoons"); +drum printf("spoons"); +trumpets printf("spoons"); +trumpet printf("spoons"); +violins printf("spoons"); +violin printf("spoons"); +clarinets printf("spoons"); +clarinet printf("spoons"); +trombones printf("spoons"); +trombone printf("spoons"); +oboes printf("spoons"); +oboe printf("spoons"); +flutes printf("spoons"); +flute printf("spoons"); +tubas printf("spoons"); +tuba printf("spoons"); +Data printf("Info"); +data printf("info"); +Directory printf("Lockup"); +directory printf("lockup"); +Directories printf("Lockups"); +directories printf("lockups"); +[Pp]rocess { switch(rand()%2) + { + case 0: printf("Queen Bess"); break; + case 1: printf("Rudolf 'Ess"); break; + } + } +[Cc]omputer printf("French Tutor"); +[Bb]yte printf("Jimmy White"); +[Ff]iles printf("Nobby Stiles"); +[Ff]ile printf("Royal Mile"); +[Ll]anguage printf("'Am Sandwich"); +[Zz]ero printf("Emperor Nero"); +[Jj]ob printf("Uncle Bob"); +[Ss]hell printf("Bow Bell"); +[Ss]ave printf("Chas'n'Dave"); +[Ll]oad printf("Old Kent Road"); +[Mm]ouse printf("Doll's 'Ouse"); +[Bb]uffer printf("Sausage Stuffer"); +[Kk]eyboard printf("Henry Ford"); +[Mm]anual printf("Cocker Spaniel"); +[Ss]creen printf("James Dean"); +[Pp]rinter printf("'Arold Pinter"); +[Pp]lotter printf("Pansy Potter"); +[Cc]ompiler printf("Martin Tyler"); +[Ss]tring printf("Emperor Ming"); +[Bb]rain printf("Michael Caine"); +[Pp][Aa][Ss][Cc][Aa][Ll] { switch(rand()%2) + { + case 0: printf("Pall Mall"); break; + case 1: printf("Roald Dahl"); break; + } + } +[Aa][Ll][Gg][Oo][Ll] printf("Johnny Ball"); +[Ff][Oo][Rr][Tt][Rr][Aa][Nn] printf("Manfred Mann"); +[Cc][Oo][Bb][Oo][Ll] printf("Albert Hall"); +Stopped printf("'Ad the mockers put on"); +stopped printf("'ad the mockers put on"); +Stopping printf("Putting the mockers on"); +stopping printf("putting the mockers on"); +stops printf("puts the mockers on"); +stop printf("put the mockers on"); +STOP printf("Put The Mockers On"); +[Ll]ondoner printf("Cockney"); +friend { switch(rand()%3) + { + case 0: printf("mucker"); break; + case 1: printf("mate"); break; + case 2: printf("china"); break; + } + } +"a h" printf("an '"); +"A h" printf("An '"); +" h" printf(" '"); +" H" printf(" '"); +" C-" printf(" Bruce Lee-"); +" C " { switch(rand()%4) + { + case 0: printf(" Bruce Lee "); break; + case 1: printf(" Circus Flea "); break; + case 2: printf(" Bumble Bee "); break; + case 3: printf(" Door Key "); break; + } + } +" C." printf(" Circus Flea."); +Th printf("F"); +Wh printf("W"); +wh printf("w"); +aw printf("or"); +" sing" ECHO; +" ring" ECHO; +"ing " printf("in' "); +" th" printf(" f"); +"th" printf("ff"); +". " { switch(rand()%32) + { + case 0: printf(". I'll get out me spoons. "); break; + case 1: printf(". Yer can't 'ave a knees-up wivout a joanna. "); break; + case 2: printf(". Cor blimey guv, would I lie to you. "); break; + case 3: printf(". I'll make us all a nice cup of tea. "); break; + default: ECHO; break; + } + } +"? " { switch(rand()%3) + { + case 0: printf(", mate? "); break; + case 1: printf(", guv? "); break; + case 2: printf(", squire? "); break; + } + } +"! " { switch(rand()%6) + { + case 0: printf(", cor blimey! "); break; + case 1: printf("! Struth! "); break; + case 2: printf(", guv! "); break; + case 3: printf("! Honest guv! "); break; + case 4: printf(", mate! "); break; + case 5: ECHO; break; + } + } +. printf(yytext); +\n printf("\n"); +%% + +main() +{ + srand(getpid()); + yylex(); +} diff --git a/kraut.dir/destructions b/kraut.dir/destructions new file mode 100644 index 0000000..4390437 --- /dev/null +++ b/kraut.dir/destructions @@ -0,0 +1,36 @@ + Kraut + +++++++++++++++++ +Compiling Kraut: + +You should have the files: kraut.c and kraut.l and lex.yy.c + + +kraut.l must be run thru the unix 'lex' utility to produce the file lex.yy.c +Then compile kraut.c and lex.yy.c to produce kraut + + $lex kraut.l + $cc kraut.c lex.yy.c -o kraut + (You may get a list of warnings from the compiler. Ignore them.) + +Note: lex.yy.c is included in this package. You only need to use lex if you +wish to make changes to kraut. + +Using Kraut: + + Kraut uses standard input and output. + +examples: + +To translate a file called 'note' and output kraut to a file called 'knote': + + $ cat note | kraut > knote + +To translate a file called 'note' and just print it to the screen: + + $ cat note | kraut + +To have kraut wait to translate what you type at the keyboard and return it in +kraut on your screen: + + $ kraut + diff --git a/kraut.dir/kraut.c b/kraut.dir/kraut.c new file mode 100644 index 0000000..2880331 --- /dev/null +++ b/kraut.dir/kraut.c @@ -0,0 +1,21 @@ +#include +/* Kraut v0.9 */ +/* by */ +/* John Sparks */ +/* 5-5-1989 */ + +/* This is in the public domain. Do with it as you will. */ + +main() +{ +char *line; + + while(line = (char *) yylex()){ + printf("%s", line); + } +} + +yywrap () +{ + return (1); +} diff --git a/kraut.dir/kraut.l b/kraut.dir/kraut.l new file mode 100644 index 0000000..0cfc6d0 --- /dev/null +++ b/kraut.dir/kraut.l @@ -0,0 +1,80 @@ +%e 2000 +%p 5000 +%n 1000 +%k 500 +%a 4000 +%o 2000 +BW [ ] +EW [ .,;!?] + +%{ + char buf[128]; + +%} + +%% +ing return("ingkt"); +" the " return(" ze "); +"The " return("Ze "); +" with " return(" mitt "); +"With " return("Mitt "); +wr return("w-r-r"); +Wr return("W-r-r"); +R return("R-r-r"); +"Yes " return("Jawohl "); +" r" return(" r-r-r"); +"Yes." return("Jawohl."); +"Yes!" return("Jawohl!"); +"YES!" return("JAWOHL!"); +" yes " return(" ja "); +" yes." return(" ja."); +" yes!" return(" yes!"); +"No " return("Nein "); +"No!" return("Nein!"); +"No?" return("Nein?"); +" no " return(" nein "); +" no." return(" nein."); +" no!" return(" nein!"); +" no?" return(" nein?"); +[Mm]"r." return("Herr"); +[Mm]"rs." return("Frau"); +Miss return("Fraulein"); +" of " return(" uff "); +"Of " return("Uff "); +my return("mein"); +My return("Mein"); +" and " return(" undt "); +"And " return("Undt "); +"One " return("Ein "); +" one" return(" ein"); +"Is " return("Ist "); +" is " return(" ist "); +"ow " return("ow "); +"w " return("w "); +sh return("sch"); +Sh return("Sch"); +ch return("ch"); +Ch return("Ch"); +" c" return(" k"); +" C" return(" K"); + +v return("f"); +V return("F"); +" w" return(" v"); +W return("V"); +th return("d"); +Th return("D"); +[Jj]ohn return("Johann"); +[Ww]illiam return("Wilhelm"); +[Bb]rad return("Wilhelm"); +[Gg]ary return("Gerhardt"); +[Jj]on return("Hansel"); + +[a-f]"!" {sprintf(buf,"%s Naturlich!",yytext);return(buf);} +[p-z]"!" {sprintf(buf,"%s Seig Heil!",yytext);return(buf);} +. return(yytext); +\n return("\n"); + +%% + + diff --git a/kraut.dir/lex.yy.c b/kraut.dir/lex.yy.c new file mode 100644 index 0000000..038b6bb --- /dev/null +++ b/kraut.dir/lex.yy.c @@ -0,0 +1,1878 @@ +/* A lexical scanner generated by flex */ + +/* Scanner skeleton version: + * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ + */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 + +#include + + +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus +#endif +#endif + + +#ifdef __cplusplus + +#include +#include + +/* Use prototypes in function declarations. */ +#define YY_USE_PROTOS + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +#if __STDC__ + +#define YY_USE_PROTOS +#define YY_USE_CONST + +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ + +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include +#include +#define YY_USE_CONST +#define YY_USE_PROTOS +#endif + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + + +#ifdef YY_USE_PROTOS +#define YY_PROTO(proto) proto +#else +#define YY_PROTO(proto) () +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yy_start = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yy_start - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#define YY_BUF_SIZE 16384 + +typedef struct yy_buffer_state *YY_BUFFER_STATE; + +extern int yyleng; +extern FILE *yyin, *yyout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + +/* The funky do-while in the following #define is used to turn the definition + * int a single C statement (which needs a semi-colon terminator). This + * avoids problems with code like: + * + * if ( condition_holds ) + * yyless( 5 ); + * else + * do_something_else(); + * + * Prior to using the do-while the compiler would get upset at the + * "else" because it interpreted the "if" statement as being all + * done when it reached the ';' after the yyless() call. + */ + +/* Return all but the first 'n' matched characters back to the input stream. */ + +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, yytext_ptr ) + +/* The following is because we cannot portably get our hands on size_t + * (without autoconf's help, which isn't available because we want + * flex-generated scanners to compile on their own). + */ +typedef unsigned int yy_size_t; + + +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + }; + +static YY_BUFFER_STATE yy_current_buffer = 0; + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + */ +#define YY_CURRENT_BUFFER yy_current_buffer + + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; + +static int yy_n_chars; /* number of characters read into yy_ch_buf */ + + +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 1; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart YY_PROTO(( FILE *input_file )); + +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) + +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); + +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +static void yy_flex_free YY_PROTO(( void * )); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) + +typedef unsigned char YY_CHAR; +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +typedef int yy_state_type; +extern char *yytext; +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yy_c_buf_p = yy_cp; + +#define YY_NUM_RULES 60 +#define YY_END_OF_BUFFER 61 +static yyconst short int yy_accept[138] = + { 0, + 0, 0, 61, 58, 59, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 8, 58, 58, 46, 48, + 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, + 45, 58, 44, 0, 43, 0, 0, 0, 10, 0, + 47, 0, 0, 0, 42, 0, 0, 0, 0, 0, + 30, 0, 0, 0, 40, 50, 0, 7, 0, 0, + 56, 41, 0, 29, 0, 57, 39, 49, 38, 0, + 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 35, 0, 55, 0, 24, 0, 17, 18, + 19, 28, 0, 0, 0, 0, 0, 0, 1, 37, + + 0, 36, 20, 22, 21, 23, 27, 34, 0, 0, + 0, 32, 53, 54, 51, 26, 25, 33, 3, 0, + 0, 13, 9, 12, 11, 31, 2, 0, 14, 16, + 15, 0, 5, 4, 0, 52, 0 + } ; + +static yyconst int yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 4, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 6, 1, 7, 8, 9, 1, 10, 1, + 11, 1, 12, 13, 1, 1, 14, 15, 16, 1, + 1, 17, 18, 19, 1, 20, 21, 1, 22, 1, + 1, 1, 1, 1, 1, 1, 23, 24, 25, 26, + + 27, 28, 29, 30, 31, 13, 1, 32, 33, 34, + 35, 36, 36, 37, 38, 39, 36, 40, 41, 36, + 42, 36, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst int yy_meta[43] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1 + } ; + +static yyconst short int yy_base[138] = + { 0, + 0, 0, 156, 157, 157, 34, 121, 117, 123, 129, + 113, 115, 13, 114, 17, 157, 118, 117, 157, 15, + 37, 142, 44, 49, 111, 12, 103, 139, 52, 54, + 138, 57, 157, 107, 157, 102, 104, 38, 157, 108, + 106, 109, 109, 111, 157, 96, 129, 33, 93, 57, + 157, 74, 127, 102, 157, 101, 51, 157, 109, 88, + 157, 157, 96, 157, 121, 157, 157, 157, 157, 91, + 157, 96, 118, 93, 117, 92, 91, 78, 78, 112, + 88, 71, 157, 78, 157, 73, 157, 105, 157, 157, + 157, 157, 106, 105, 75, 76, 101, 82, 157, 157, + + 101, 157, 157, 157, 157, 157, 157, 157, 100, 72, + 88, 157, 157, 157, 157, 157, 157, 157, 157, 70, + 97, 157, 157, 157, 157, 157, 157, 86, 157, 157, + 157, 51, 157, 157, 37, 157, 157 + } ; + +static yyconst short int yy_def[138] = + { 0, + 137, 1, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 0 + } ; + +static yyconst short int yy_nxt[200] = + { 0, + 4, 5, 6, 4, 4, 4, 7, 8, 9, 4, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 22, 22, 22, 10, 4, + 25, 4, 26, 4, 27, 28, 28, 29, 30, 31, + 32, 28, 33, 49, 53, 57, 59, 61, 50, 50, + 54, 58, 61, 64, 51, 66, 34, 66, 35, 69, + 66, 87, 84, 60, 36, 75, 85, 37, 38, 136, + 39, 76, 40, 135, 41, 42, 89, 90, 62, 91, + 44, 67, 95, 68, 123, 124, 125, 70, 134, 96, + 129, 130, 131, 71, 88, 103, 104, 105, 106, 133, + + 132, 128, 127, 126, 122, 121, 120, 119, 118, 117, + 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, + 102, 101, 95, 100, 99, 98, 97, 94, 93, 92, + 86, 83, 82, 81, 80, 79, 78, 77, 74, 73, + 72, 66, 66, 65, 63, 61, 56, 55, 52, 48, + 47, 46, 45, 44, 43, 137, 3, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137 + + } ; + +static yyconst short int yy_chk[200] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 6, 13, 15, 20, 21, 23, 26, 13, + 15, 20, 24, 26, 13, 29, 6, 30, 6, 32, + 32, 50, 48, 21, 6, 38, 48, 6, 6, 135, + 6, 38, 6, 132, 6, 6, 52, 52, 24, 52, + 23, 29, 57, 30, 98, 98, 98, 32, 128, 57, + 111, 111, 111, 32, 50, 74, 74, 74, 74, 121, + + 120, 110, 109, 101, 97, 96, 95, 94, 93, 88, + 86, 84, 82, 81, 80, 79, 78, 77, 76, 75, + 73, 72, 70, 65, 63, 60, 59, 56, 54, 53, + 49, 47, 46, 44, 43, 42, 41, 40, 37, 36, + 34, 31, 28, 27, 25, 22, 18, 17, 14, 12, + 11, 10, 9, 8, 7, 3, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137 + + } ; + +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *yytext; +#line 1 "kraut.l" +#define INITIAL 0 +#line 11 "kraut.l" + char buf[128]; + +#line 454 "lex.yy.c" + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap YY_PROTO(( void )); +#else +extern int yywrap YY_PROTO(( void )); +#endif +#endif + +#ifndef YY_NO_UNPUT +static void yyunput YY_PROTO(( int c, char *buf_ptr )); +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen YY_PROTO(( yyconst char * )); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput YY_PROTO(( void )); +#else +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static int yy_top_state YY_PROTO(( void )); +#endif + +#else +#define YY_NO_PUSH_STATE 1 +#define YY_NO_POP_STATE 1 +#define YY_NO_TOP_STATE 1 +#endif + +#ifdef YY_MALLOC_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include +#endif +#else +/* Just try to get by without declaring the routines. This will fail + * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) + * or sizeof(void*) != sizeof(int). + */ +#endif +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 8192 +#endif + +/* Copy whatever the last rule matched to the standard output. */ + +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( yy_current_buffer->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ + && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL int yylex YY_PROTO(( void )) +#endif + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + +#line 15 "kraut.l" + +#line 607 "lex.yy.c" + + if ( yy_init ) + { + yy_init = 0; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yy_start ) + yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_load_buffer_state(); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yy_start; +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 138 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 157 ); + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + +do_action: /* This label is used only to access EOF actions. */ + + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yy_hold_char; + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 16 "kraut.l" +return("ingkt"); + YY_BREAK +case 2: +YY_RULE_SETUP +#line 17 "kraut.l" +return(" ze "); + YY_BREAK +case 3: +YY_RULE_SETUP +#line 18 "kraut.l" +return("Ze "); + YY_BREAK +case 4: +YY_RULE_SETUP +#line 19 "kraut.l" +return(" mitt "); + YY_BREAK +case 5: +YY_RULE_SETUP +#line 20 "kraut.l" +return("Mitt "); + YY_BREAK +case 6: +YY_RULE_SETUP +#line 21 "kraut.l" +return("w-r-r"); + YY_BREAK +case 7: +YY_RULE_SETUP +#line 22 "kraut.l" +return("W-r-r"); + YY_BREAK +case 8: +YY_RULE_SETUP +#line 23 "kraut.l" +return("R-r-r"); + YY_BREAK +case 9: +YY_RULE_SETUP +#line 24 "kraut.l" +return("Jawohl "); + YY_BREAK +case 10: +YY_RULE_SETUP +#line 25 "kraut.l" +return(" r-r-r"); + YY_BREAK +case 11: +YY_RULE_SETUP +#line 26 "kraut.l" +return("Jawohl."); + YY_BREAK +case 12: +YY_RULE_SETUP +#line 27 "kraut.l" +return("Jawohl!"); + YY_BREAK +case 13: +YY_RULE_SETUP +#line 28 "kraut.l" +return("JAWOHL!"); + YY_BREAK +case 14: +YY_RULE_SETUP +#line 29 "kraut.l" +return(" ja "); + YY_BREAK +case 15: +YY_RULE_SETUP +#line 30 "kraut.l" +return(" ja."); + YY_BREAK +case 16: +YY_RULE_SETUP +#line 31 "kraut.l" +return(" yes!"); + YY_BREAK +case 17: +YY_RULE_SETUP +#line 32 "kraut.l" +return("Nein "); + YY_BREAK +case 18: +YY_RULE_SETUP +#line 33 "kraut.l" +return("Nein!"); + YY_BREAK +case 19: +YY_RULE_SETUP +#line 34 "kraut.l" +return("Nein?"); + YY_BREAK +case 20: +YY_RULE_SETUP +#line 35 "kraut.l" +return(" nein "); + YY_BREAK +case 21: +YY_RULE_SETUP +#line 36 "kraut.l" +return(" nein."); + YY_BREAK +case 22: +YY_RULE_SETUP +#line 37 "kraut.l" +return(" nein!"); + YY_BREAK +case 23: +YY_RULE_SETUP +#line 38 "kraut.l" +return(" nein?"); + YY_BREAK +case 24: +YY_RULE_SETUP +#line 39 "kraut.l" +return("Herr"); + YY_BREAK +case 25: +YY_RULE_SETUP +#line 40 "kraut.l" +return("Frau"); + YY_BREAK +case 26: +YY_RULE_SETUP +#line 41 "kraut.l" +return("Fraulein"); + YY_BREAK +case 27: +YY_RULE_SETUP +#line 42 "kraut.l" +return(" uff "); + YY_BREAK +case 28: +YY_RULE_SETUP +#line 43 "kraut.l" +return("Uff "); + YY_BREAK +case 29: +YY_RULE_SETUP +#line 44 "kraut.l" +return("mein"); + YY_BREAK +case 30: +YY_RULE_SETUP +#line 45 "kraut.l" +return("Mein"); + YY_BREAK +case 31: +YY_RULE_SETUP +#line 46 "kraut.l" +return(" undt "); + YY_BREAK +case 32: +YY_RULE_SETUP +#line 47 "kraut.l" +return("Undt "); + YY_BREAK +case 33: +YY_RULE_SETUP +#line 48 "kraut.l" +return("Ein "); + YY_BREAK +case 34: +YY_RULE_SETUP +#line 49 "kraut.l" +return(" ein"); + YY_BREAK +case 35: +YY_RULE_SETUP +#line 50 "kraut.l" +return("Ist "); + YY_BREAK +case 36: +YY_RULE_SETUP +#line 51 "kraut.l" +return(" ist "); + YY_BREAK +case 37: +YY_RULE_SETUP +#line 52 "kraut.l" +return("ow "); + YY_BREAK +case 38: +YY_RULE_SETUP +#line 53 "kraut.l" +return("w "); + YY_BREAK +case 39: +YY_RULE_SETUP +#line 54 "kraut.l" +return("sch"); + YY_BREAK +case 40: +YY_RULE_SETUP +#line 55 "kraut.l" +return("Sch"); + YY_BREAK +case 41: +YY_RULE_SETUP +#line 56 "kraut.l" +return("ch"); + YY_BREAK +case 42: +YY_RULE_SETUP +#line 57 "kraut.l" +return("Ch"); + YY_BREAK +case 43: +YY_RULE_SETUP +#line 58 "kraut.l" +return(" k"); + YY_BREAK +case 44: +YY_RULE_SETUP +#line 59 "kraut.l" +return(" K"); + YY_BREAK +case 45: +YY_RULE_SETUP +#line 61 "kraut.l" +return("f"); + YY_BREAK +case 46: +YY_RULE_SETUP +#line 62 "kraut.l" +return("F"); + YY_BREAK +case 47: +YY_RULE_SETUP +#line 63 "kraut.l" +return(" v"); + YY_BREAK +case 48: +YY_RULE_SETUP +#line 64 "kraut.l" +return("V"); + YY_BREAK +case 49: +YY_RULE_SETUP +#line 65 "kraut.l" +return("d"); + YY_BREAK +case 50: +YY_RULE_SETUP +#line 66 "kraut.l" +return("D"); + YY_BREAK +case 51: +YY_RULE_SETUP +#line 67 "kraut.l" +return("Johann"); + YY_BREAK +case 52: +YY_RULE_SETUP +#line 68 "kraut.l" +return("Wilhelm"); + YY_BREAK +case 53: +YY_RULE_SETUP +#line 69 "kraut.l" +return("Wilhelm"); + YY_BREAK +case 54: +YY_RULE_SETUP +#line 70 "kraut.l" +return("Gerhardt"); + YY_BREAK +case 55: +YY_RULE_SETUP +#line 71 "kraut.l" +return("Hansel"); + YY_BREAK +case 56: +YY_RULE_SETUP +#line 73 "kraut.l" +{sprintf(buf,"%s Naturlich!",yytext);return(buf);} + YY_BREAK +case 57: +YY_RULE_SETUP +#line 74 "kraut.l" +{sprintf(buf,"%s Seig Heil!",yytext);return(buf);} + YY_BREAK +case 58: +YY_RULE_SETUP +#line 75 "kraut.l" +return(yytext); + YY_BREAK +case 59: +YY_RULE_SETUP +#line 76 "kraut.l" +return("\n"); + YY_BREAK +case 60: +YY_RULE_SETUP +#line 78 "kraut.l" +ECHO; + YY_BREAK +#line 990 "lex.yy.c" +case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between yy_current_buffer and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yy_n_chars = yy_current_buffer->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + yy_did_buffer_switch_on_eof = 0; + + if ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = + yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yy_c_buf_p = + &yy_current_buffer->yy_ch_buf[yy_n_chars]; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of yylex */ + + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ + +static int yy_get_next_buffer() + { + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = yytext_ptr; + register int number_to_move, i; + int ret_val; + + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( yy_current_buffer->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + yy_current_buffer->yy_n_chars = yy_n_chars = 0; + + else + { + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ +#ifdef YY_USES_REJECT + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +#else + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = yy_current_buffer; + + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = yy_current_buffer->yy_buf_size - + number_to_move - 1; +#endif + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); + + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + if ( yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; + + return ret_val; + } + + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +static yy_state_type yy_get_previous_state() + { + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = yy_start; + + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 138 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; + } + + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else +static yy_state_type yy_try_NUL_trans( yy_current_state ) +yy_state_type yy_current_state; +#endif + { + register int yy_is_jam; + register char *yy_cp = yy_c_buf_p; + + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 138 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 137); + + return yy_is_jam ? 0 : yy_current_state; + } + + +#ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static void yyunput( int c, register char *yy_bp ) +#else +static void yyunput( c, yy_bp ) +int c; +register char *yy_bp; +#endif + { + register char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } +#endif /* ifndef YY_NO_UNPUT */ + + +#ifdef __cplusplus +static int yyinput() +#else +static int input() +#endif + { + int c; + + *yy_c_buf_p = yy_hold_char; + + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = yy_c_buf_p - yytext_ptr; + ++yy_c_buf_p; + + switch ( yy_get_next_buffer() ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin ); + + /* fall through */ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + return EOF; + + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ + *yy_c_buf_p = '\0'; /* preserve yytext */ + yy_hold_char = *++yy_c_buf_p; + + + return c; + } + + +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else +void yyrestart( input_file ) +FILE *input_file; +#endif + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); + } + + +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else +void yy_switch_to_buffer( new_buffer ) +YY_BUFFER_STATE new_buffer; +#endif + { + if ( yy_current_buffer == new_buffer ) + return; + + if ( yy_current_buffer ) + { + /* Flush out information for old buffer. */ + *yy_c_buf_p = yy_hold_char; + yy_current_buffer->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + yy_current_buffer = new_buffer; + yy_load_buffer_state(); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yy_did_buffer_switch_on_eof = 1; + } + + +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else +void yy_load_buffer_state() +#endif + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } + + +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else +YY_BUFFER_STATE yy_create_buffer( file, size ) +FILE *file; +int size; +#endif + { + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; + } + + +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else +void yy_delete_buffer( b ) +YY_BUFFER_STATE b; +#endif + { + if ( ! b ) + return; + + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); + + yy_flex_free( (void *) b ); + } + + +#ifndef YY_ALWAYS_INTERACTIVE +#ifndef YY_NEVER_INTERACTIVE +extern int isatty YY_PROTO(( int )); +#endif +#endif + +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else +void yy_init_buffer( b, file ) +YY_BUFFER_STATE b; +FILE *file; +#endif + + + { + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + +#if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; +#else +#if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; +#else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } + + +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else +void yy_flush_buffer( b ) +YY_BUFFER_STATE b; +#endif + + { + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == yy_current_buffer ) + yy_load_buffer_state(); + } + + +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; + } +#endif + + +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) +#else +YY_BUFFER_STATE yy_scan_string( yy_str ) +yyconst char *yy_str; +#endif + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; + + return yy_scan_bytes( yy_str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; + } +#endif + + +#ifndef YY_NO_PUSH_STATE +#ifdef YY_USE_PROTOS +static void yy_push_state( int new_state ) +#else +static void yy_push_state( new_state ) +int new_state; +#endif + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; + + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); + + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); + + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); + + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } + + yy_start_stack[yy_start_stack_ptr++] = YY_START; + + BEGIN(new_state); + } +#endif + + +#ifndef YY_NO_POP_STATE +static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } +#endif + + +#ifndef YY_NO_TOP_STATE +static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } +#endif + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +#ifdef YY_USE_PROTOS +static void yy_fatal_error( yyconst char msg[] ) +#else +static void yy_fatal_error( msg ) +char msg[]; +#endif + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } + + + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + yytext[yyleng] = yy_hold_char; \ + yy_c_buf_p = yytext + n; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + yyleng = n; \ + } \ + while ( 0 ) + + +/* Internal utility routines. */ + +#ifndef yytext_ptr +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else +static void yy_flex_strncpy( s1, s2, n ) +char *s1; +yyconst char *s2; +int n; +#endif + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } +#endif + +#ifdef YY_NEED_STRLEN +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif + { + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; + } +#endif + + +#ifdef YY_USE_PROTOS +static void *yy_flex_alloc( yy_size_t size ) +#else +static void *yy_flex_alloc( size ) +yy_size_t size; +#endif + { + return (void *) malloc( size ); + } + +#ifdef YY_USE_PROTOS +static void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +static void *yy_flex_realloc( ptr, size ) +void *ptr; +yy_size_t size; +#endif + { + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); + } + +#ifdef YY_USE_PROTOS +static void yy_flex_free( void *ptr ) +#else +static void yy_flex_free( ptr ) +void *ptr; +#endif + { + free( ptr ); + } + +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +#line 78 "kraut.l" + + + diff --git a/kraut.l b/kraut.l new file mode 100644 index 0000000..8435e51 --- /dev/null +++ b/kraut.l @@ -0,0 +1,82 @@ +%e 2000 +%p 5000 +%n 1000 +%k 500 +%a 4000 +%o 2000 +BW [ ] +EW [ .,;!?] + +%{ +#include + +char buf[128]; +%} + +%% +ing printf("ingkt"); +" the " printf(" ze "); +"The " printf("Ze "); +" with " printf(" mitt "); +"With " printf("Mitt "); +wr printf("w-r-r"); +Wr printf("W-r-r"); +R printf("R-r-r"); +"Yes " printf("Jawohl "); +" r" printf(" r-r-r"); +"Yes." printf("Jawohl."); +"Yes!" printf("Jawohl!"); +"YES!" printf("JAWOHL!"); +" yes " printf(" ja "); +" yes." printf(" ja."); +" yes!" printf(" yes!"); +"No " printf("Nein "); +"No!" printf("Nein!"); +"No?" printf("Nein?"); +" no " printf(" nein "); +" no." printf(" nein."); +" no!" printf(" nein!"); +" no?" printf(" nein?"); +[Mm]"r." printf("Herr"); +[Mm]"rs." printf("Frau"); +Miss printf("Fraulein"); +" of " printf(" uff "); +"Of " printf("Uff "); +my printf("mein"); +My printf("Mein"); +" and " printf(" undt "); +"And " printf("Undt "); +"One " printf("Ein "); +" one" printf(" ein"); +"Is " printf("Ist "); +" is " printf(" ist "); +"ow " printf("ow "); +"w " printf("w "); +sh printf("sch"); +Sh printf("Sch"); +ch printf("ch"); +Ch printf("Ch"); +" c" printf(" k"); +" C" printf(" K"); + +v printf("f"); +V printf("F"); +" w" printf(" v"); +W printf("V"); +th printf("d"); +Th printf("D"); +[Jj]ohn printf("Johann"); +[Ww]illiam printf("Wilhelm"); +[Bb]rad printf("Wilhelm"); +[Gg]ary printf("Gerhardt"); +[Jj]on printf("Hansel"); + +[a-f]"!" {sprintf(buf,"%s Naturlich!",yytext);printf(buf);} +[p-z]"!" {sprintf(buf,"%s Seig Heil!",yytext);printf(buf);} +.|'\n' ECHO; + +%% +main() +{ + yylex(); +} diff --git a/ky00te.dir/README.ky00te b/ky00te.dir/README.ky00te new file mode 100644 index 0000000..65da749 --- /dev/null +++ b/ky00te.dir/README.ky00te @@ -0,0 +1,82 @@ +This program is (c) 1994, Brent E. Edwards. Feel free to distribute the +complete program world-wide. (Please do NOT break apart this text file +from the program.) + +This program is under absolutely no warrantee of any kind. + +If you have any questions about this program, please send them to +edwardsb@cs.rpi.edu. + +This program is dedicated to Conrad Wong. + +This program is catware. If you find it useful in any way, pay for this +program by spending one hour petting one or several cats. + + +=================================================== + + +Purpose: + This program places a very cute (and familiar to FurryMuck fans) + accent to any text file. It is designed for UNIX systems. + It requires cc, lex, and yacc to be in your path. + +Compiling: + To compile on a UNIX system, type 'make' + +Running: + To do a line-by-line translation of your text, type 'ky00te'. + Control-D will halt the program. + + To convert a text file and display it on the screen, type + 'ky00te < filename | more', where filename is the file to convert. + + To convert a text file and save it to a file, type + 'ky00te < filename.in > filename.out', where filename.in is the + file to convert and filename.out is the place to put it. + + You can also add an accent to the output of any program by + typing ' | ky00te'. + +Petting the cat: + Stroke with the furs, not against them. + +==================================================== + +Program version information: + +Program version 1.00: 13 December 1994 + +Program version 1.10: 15 December 1994 + Version 1.00 was a memory hog. Also, adds 'fur' and 'meow' to +list of cat-ch phrases. + +Program version 1.11: 16 December 1994 + With Tobias Kuhler's (ukjp@rz.uni-karlsruhe.de) repeated suggestion, + the program now only doubles (not triples) 'r' and no longer capitalizes + fur. He also suggested the following improvements: + at a, at the -> atta + in a, in the -> ynna + is a, is the -> yssa + on a, on the -> onna + with a, with the -> wyffa + the -> da + you -> ya + and -> 'n + with -> wyf + to -> ta + + This version also no longer uses the same 'meow'; it switches between + 'meow', 'mew', and 'mu' (weighted to the first). + + I've also added: + lot of -> lotta + is so -> yssa + when -> w'en + with -> wyf (when used to start a word) + your -> yer + not, n't -> na' + + + The README file has been reorganized, and the dedication made explicit. + diff --git a/ky00te.dir/ky00te.lex b/ky00te.dir/ky00te.lex new file mode 100644 index 0000000..63f877c --- /dev/null +++ b/ky00te.dir/ky00te.lex @@ -0,0 +1,64 @@ +%{ + +#include "y.tab.h" +extern int yylval; + +%} + +%% +i { yylval = 'y'; return(LETTER); } +I { yylval = 'Y'; return(LETTER); } +cks { yylval = 'x'; return(LETTER); } +ks { yylval = 'x'; return(LETTER); } +cute { return(CUTE); } +fluff { return(FLUFF); } +smile { return(SMILE); } +grin { return(SMILE); } +laugh { return(SMILE); } +chuckle { return(SMILE); } +pr { return(PURR); } +p[aeiou]*r { return(PURR); } +f[aeiou]+r { return(FUR); } +m[aeiou]+/[^.,s?! ] { return(MEOW); } /*UN*/ +"at a" { return(ATTA); } +"at the" { return(ATTA); } +"in a" { return(YNNA); } +"in the" { return(YNNA); } +"is a" { return(YSSA); } +"is the" { return(YSSA); } +"is so" { return(YSSA); } +"on a" { return(ONNA); } +"on the" { return(ONNA); } +"with a" { return(WYFFA); } +"with the" { return(WYFFA); } +"lot of" { return(LOTTA); } +" with " { return(WYF); } +" with" { return(WYFF); } +^"with " { return(WYF); } +^"with" { return(WYFF); } +" with"$ { return(WYF); } +" the " { return(DA); } +^"the " { return(DA); } +" the"$ { return(DA); } +" your" { return(YER); } +^your { return(YER); } +" you" { return(YA); } +^you { return(YA); } +" and " { return(AN); } +^"and " { return(AN); } +" and"$ { return(AN); } +" to " { return(TA); } +^"to " { return(TA); } +" to"$ { return(TA); } +" when " { return(WEN); } +^"when " { return(WEN); } +" when"$ { return(WEN); } +"n't" { return(NA); } /*UN*/ +" not" { return(NA); } /*UN*/ +[ \t] { return(' '); } +. { yylval = yytext[0]; return(LETTER); } +%% + + + + diff --git a/ky00te.dir/ky00te.yacc b/ky00te.dir/ky00te.yacc new file mode 100644 index 0000000..ac49c06 --- /dev/null +++ b/ky00te.dir/ky00te.yacc @@ -0,0 +1,133 @@ +%{ + +#include +typedef int INT; + +#define YYSTYPE INT + +%} + +%token CUTE +%token FLUFF +%token SMILE +%token PURR +%token FUR +%token MEOW +%token ATTA +%token YNNA +%token YSSA +%token ONNA +%token WYFFA +%token LOTTA +%token WYF +%token WYFF +%token DA +%token YER +%token YA +%token AN +%token TA +%token WEN +%token NA /*UN*/ +%token LETTER + +%% + +s: + | s t + | s ' ' + { + if (rand() % 30 < 1) + { + int inRand; + + inRand = rand() % 5; + + switch(inRand) + { + case 0: + printf(" *truffle break!* "); + break; + + case 1: + printf(" *catnap break!* "); + break; + + case 2: + printf(" *purrpurr* "); + break; + + case 3: + printf(" *meow!* "); + break; + + case 4: + printf(" *fluff!* "); + break; + } + } + else + { + printf(" "); + } + } + ; + +t: CUTE { printf("ky00te!"); } + | FLUFF { printf("*fluff!*"); } + | SMILE { printf("};)"); } + | PURR { printf("purr"); } + | FUR { printf("fur"); } + | MEOW { int inRand; + + inRand = rand() % 5; + + switch(inRand) + { + case 0: + case 1: + case 2: + printf("meow"); + break; + case 3: + case 4: + printf("mew"); + } + } + | ATTA { printf("atta"); } + | YNNA { printf("ynna"); } + | YSSA { printf("yssa"); } + | ONNA { printf("onna"); } + | WYFFA { printf("wyffa"); } + | LOTTA { printf("lotta"); } + | WYF { printf(" wyf "); } + | WYFF { printf(" wyff"); } + | DA { printf(" da "); } + | YER { printf(" yer"); } + | YA { printf(" ya"); } + | AN { printf(" 'n "); } + | TA { printf(" ta "); } + | WEN { printf(" w'en "); } + | NA { printf(" na'"); } /*UN*/ + | LETTER { if (yylval == 'r') + printf("rr"); + else + printf("%c", $1); } + ; + + +%% + +extern char mylval; + +void yyerror(char *s) { + printf("%s\n",s); +} + +int main() +{ + yyparse(); + + return 0; +} + + diff --git a/ky00te.dir/makefile b/ky00te.dir/makefile new file mode 100644 index 0000000..0351008 --- /dev/null +++ b/ky00te.dir/makefile @@ -0,0 +1,21 @@ +all: ky00te + +clean: + rm -f y.tab.* lex.yy.* + rm -f ../ky00te + +ky00te: y.tab.o lex.yy.o + cc -o ../ky00te lex.yy.o y.tab.o -lfl + +lex.yy.o: lex.yy.c y.tab.h + cc -c lex.yy.c + +y.tab.o: y.tab.c + cc -c y.tab.c + +lex.yy.c: ky00te.lex + flex ky00te.lex + +y.tab.c: ky00te.yacc + yacc -d ky00te.yacc + diff --git a/makesample.sh b/makesample.sh new file mode 100644 index 0000000..4fc1729 --- /dev/null +++ b/makesample.sh @@ -0,0 +1,5 @@ +#!/bin/sh +echo $1 >>SAMPLES +echo "-------------" >>SAMPLES +echo -e "Here's how this filter sounds, in everyday use.\nThis line is another sample of this filter's output." | ./$1 >>SAMPLES +echo "" >>SAMPLES \ No newline at end of file diff --git a/marc-barrett.l b/marc-barrett.l new file mode 100644 index 0000000..23cd413 --- /dev/null +++ b/marc-barrett.l @@ -0,0 +1,137 @@ +From: dankmyer@hilbert.math.grin.edu (Kirt A Dankmyer) +Newsgroups: alt.sources +Subject: mb.l +Date: 4 Dec 1992 15:08:40 -0600 +Message-ID: <9212042108.AA10484@hilbert> + +%{ + + /* Marc Barrett posting translator; + amaze your friends + To compile: lex mb.l + cc -o mb lex.yy.c -ll + To use: + mb < Your_MB_posting + */ + + char buf[128]; +%} +%a 3000 +%e 3000 +%p 5000 +%n 3000 +%% +"lots and lots" printf("few"); +"HyperCard" printf("crap"); +"real," printf("phony,"); +"real." printf("phony."); +"real " printf("phony "); +"People" printf("I"); +"numerous" printf("1 or 2 (I think)"); +" other" printf(" lamer"); +"nightmare" printf("paradise"); +"bad" printf("excellent"); +"may" printf("will"); +"UNUSABLE" printf("FAST AS HELL"); +"pokish" printf("slower than a snail"); +"junior" printf("intelligent"); +"potentially" printf("probably"); +"I know" printf("I think"); +"looks a thousand times better" printf("looks worse"); +"years ago" printf("years ago (before I bought an Amiga) "); +"no improvements" printf("many improvements"); +"As far as I know" printf("I don't really know"); +"as far as I know" printf("but what do I know"); +"totally official" printf("a wild rumor"); +"kludged" printf("designed"); +"be any" printf("be some"); +"also likely never" printf("also probably"); +"likely never" printf("probably"); +"everyone" printf("some people"); +"being unreasonable" printf("being an idiot"); +"I don't understand" printf("I dont' understand. "); +"it is unreasonable" printf("it is stupid. "); +"everybody" printf("some people"); +"have never" printf("will have"); +"must have" printf("could have"); +"will never" printf("will"); +"never will" printf("will again soon"); +"would not" printf("may"); +"the need" printf("some silly things"); +"The problem" printf("My problem"); +"the problem" printf("my problem"); +"the simple fact" printf("my opinion"); +"simply" printf("(with great difficulty)"); +"it's kind of embarassing" printf("I'm kind of embarassing"); +"I often see" printf("I never see"); +"I questioned" printf("I flamed"); +"development costs" printf("development costs (which, I'd like to remind you, I know nothing about)"); +"IMO" printf("(belch)"); +"to explain" printf("to give my wacky ideas about"); +"practically zero" printf("astronomical"); +"I think" printf("I think. "); +"don't think" printf("don't think. "); +"do not think." printf("do not think. "); +"I am trying" printf("I am flaming"); +"I've" printf("Commodore has"); +"Beware the ides of September" printf("I'm gonna flame any new stuff shown in September"); +"Sad" printf("Weird"); +"sad" printf("weird"); +"I WAS RIGHT" printf("I DON'T KNOW WHAT I'M TALKING ABOUT"); +"aren't" printf("are"); +"anymore" printf("still"); +" are " printf(" aren't "); +"lost" printf("gained"); +" low " printf(" high "); +" high " printf(" low "); +"isn't" printf("is"); +"all of" printf("none of"); +"is not" printf("is"); +"stagnates" printf("flourishes"); +"never" printf("always"); +"short-sightedness" printf("genius"); +"inferior" printf("superior"); +"superior" printf("inferior"); +"few " printf("many "); +"many" printf("few"); +"no improvements" printf("many improvements"); +"different" printf("similar"); +"the only substantial" printf("one of the many"); +"best" printf("worst"); +"worst" printf("best"); +"except for" printf("including"); +"worse" printf("better"); +"better" printf("worse"); +"nothing" printf("something"); +"something" printf("nothing"); +"no longer" printf("still"); +"biggest" printf("smallest"); +"high" printf("low"); +" low" printf(" high"); +"does not" printf("does"); +"doesn't" printf("does"); +"brilliantly" printf("inferiorly"); +"Avoid" printf("Search out"); +"lots of" printf("a few"); +"beautifully" printf("horribly"); +"wrong" printf("right"); +"right" printf("wrong"); +"tight" printf("loose"); +"loose" printf("tight"); +"same" printf("different"); +"disappointing" printf("impressive"); +"pieces of shit" printf("accomplishments"); +" NO!" printf(" YES!"); +"retrogrades" printf("leaps forward"); +"garbaged" printf("incredible"); +"reduced to garbage" printf("incredible"); +"all games" printf("no games"); +"slow" printf("fast"); +"fast" printf("slow"); +"can't" printf("can"); +"won't" printf("will"); +"will" printf("won't"); +" more" printf(" less"); +"has not" printf("has"); +%% + diff --git a/mb.l b/mb.l new file mode 100644 index 0000000..23cd413 --- /dev/null +++ b/mb.l @@ -0,0 +1,137 @@ +From: dankmyer@hilbert.math.grin.edu (Kirt A Dankmyer) +Newsgroups: alt.sources +Subject: mb.l +Date: 4 Dec 1992 15:08:40 -0600 +Message-ID: <9212042108.AA10484@hilbert> + +%{ + + /* Marc Barrett posting translator; + amaze your friends + To compile: lex mb.l + cc -o mb lex.yy.c -ll + To use: + mb < Your_MB_posting + */ + + char buf[128]; +%} +%a 3000 +%e 3000 +%p 5000 +%n 3000 +%% +"lots and lots" printf("few"); +"HyperCard" printf("crap"); +"real," printf("phony,"); +"real." printf("phony."); +"real " printf("phony "); +"People" printf("I"); +"numerous" printf("1 or 2 (I think)"); +" other" printf(" lamer"); +"nightmare" printf("paradise"); +"bad" printf("excellent"); +"may" printf("will"); +"UNUSABLE" printf("FAST AS HELL"); +"pokish" printf("slower than a snail"); +"junior" printf("intelligent"); +"potentially" printf("probably"); +"I know" printf("I think"); +"looks a thousand times better" printf("looks worse"); +"years ago" printf("years ago (before I bought an Amiga) "); +"no improvements" printf("many improvements"); +"As far as I know" printf("I don't really know"); +"as far as I know" printf("but what do I know"); +"totally official" printf("a wild rumor"); +"kludged" printf("designed"); +"be any" printf("be some"); +"also likely never" printf("also probably"); +"likely never" printf("probably"); +"everyone" printf("some people"); +"being unreasonable" printf("being an idiot"); +"I don't understand" printf("I dont' understand. "); +"it is unreasonable" printf("it is stupid. "); +"everybody" printf("some people"); +"have never" printf("will have"); +"must have" printf("could have"); +"will never" printf("will"); +"never will" printf("will again soon"); +"would not" printf("may"); +"the need" printf("some silly things"); +"The problem" printf("My problem"); +"the problem" printf("my problem"); +"the simple fact" printf("my opinion"); +"simply" printf("(with great difficulty)"); +"it's kind of embarassing" printf("I'm kind of embarassing"); +"I often see" printf("I never see"); +"I questioned" printf("I flamed"); +"development costs" printf("development costs (which, I'd like to remind you, I know nothing about)"); +"IMO" printf("(belch)"); +"to explain" printf("to give my wacky ideas about"); +"practically zero" printf("astronomical"); +"I think" printf("I think. "); +"don't think" printf("don't think. "); +"do not think." printf("do not think. "); +"I am trying" printf("I am flaming"); +"I've" printf("Commodore has"); +"Beware the ides of September" printf("I'm gonna flame any new stuff shown in September"); +"Sad" printf("Weird"); +"sad" printf("weird"); +"I WAS RIGHT" printf("I DON'T KNOW WHAT I'M TALKING ABOUT"); +"aren't" printf("are"); +"anymore" printf("still"); +" are " printf(" aren't "); +"lost" printf("gained"); +" low " printf(" high "); +" high " printf(" low "); +"isn't" printf("is"); +"all of" printf("none of"); +"is not" printf("is"); +"stagnates" printf("flourishes"); +"never" printf("always"); +"short-sightedness" printf("genius"); +"inferior" printf("superior"); +"superior" printf("inferior"); +"few " printf("many "); +"many" printf("few"); +"no improvements" printf("many improvements"); +"different" printf("similar"); +"the only substantial" printf("one of the many"); +"best" printf("worst"); +"worst" printf("best"); +"except for" printf("including"); +"worse" printf("better"); +"better" printf("worse"); +"nothing" printf("something"); +"something" printf("nothing"); +"no longer" printf("still"); +"biggest" printf("smallest"); +"high" printf("low"); +" low" printf(" high"); +"does not" printf("does"); +"doesn't" printf("does"); +"brilliantly" printf("inferiorly"); +"Avoid" printf("Search out"); +"lots of" printf("a few"); +"beautifully" printf("horribly"); +"wrong" printf("right"); +"right" printf("wrong"); +"tight" printf("loose"); +"loose" printf("tight"); +"same" printf("different"); +"disappointing" printf("impressive"); +"pieces of shit" printf("accomplishments"); +" NO!" printf(" YES!"); +"retrogrades" printf("leaps forward"); +"garbaged" printf("incredible"); +"reduced to garbage" printf("incredible"); +"all games" printf("no games"); +"slow" printf("fast"); +"fast" printf("slow"); +"can't" printf("can"); +"won't" printf("will"); +"will" printf("won't"); +" more" printf(" less"); +"has not" printf("has"); +%% + diff --git a/moo.l b/moo.l new file mode 100644 index 0000000..9da3091 --- /dev/null +++ b/moo.l @@ -0,0 +1,122 @@ +%e 2000 +%p 5000 +%n 1000 +%k 500 +%a 4000 +%o 2000 +BW [ ] +EW [ .,;!?] + +%{ +/* +** The cow filter +** by Benjamin Elijah Griffin 8 May 1994 +** +** An experiment in lex written instead of a paper on Nietzsche. +** +** compile like this: +** lex moo.l +** cc -o moo lex.yy.c -ll +** rm lex.yy.c +** +** use like this: +** moo < infile > outfile +** or +** cat infile | | moo | > outfile +** +*/ + +char WhAt[]="@(#)Benjamin Elijah Griffin's moo filter for cowtalk (c) 1994\n@(#)$Header: moo.l,v 1.1 94/05/08 23:37:53 bgriffin Final $" +; + +%} + +%% + +" and " printf(" moond "); +[Uu][Nn][Ii][Xx] printf("Moonix"); +[Mm][Ss].[Dd][Oo][Ss] printf("Moo Dos"); +news printf("moos"); +[Uu]senet printf("Moosnet"); +" man " printf(" mooster "); +" men " printf(" moosters "); +woman printf("moostress"); +women printf("moostresses"); +pig printf("cop"); +[Dd]airy.[Ff]armer printf("Pimp"); +[Dd]airy.[Ff]arm printf("Farm of Ill Repute"); +[Bb]eef.[Ff]armer printf("Slave Driver"); +[Bb]eef.[Ff]arm printf("Prison"); +yogurt printf("bacteria culture"); +cheese printf("smega"); +curds printf("moist smega"); +whey printf("bile"); +buttermilk printf("foul fluid"); +butter { printf("sphinter lubrication"); + /* A _Last Tango in Paris_ joke */ } +cream printf("honey"); +beef printf("murdered meat"); +grass printf("gourmet greenry"); +hay printf("subsistance rations"); +cereal printf("fomood"); +milkmaid printf("rapist"); +[Mm]aid.a.milkin | +[Mm]aid.a.milking printf("Christmas Rapist"); +[Mm]aids.a.milkin | +[Mm]aids.a.milking printf("Christmas Rapists"); +milking printf("rape"); +rape printf("milking"); +rapist printf("milkmaid"); +veal printf("the devil's food"); +"bull fighter" printf("Grim Reaper"); +"bull fight" printf("Game of Sorrows"); +milk printf("mead"); +Milk printf("Mead"); +"cafe con latte" | +capuccino printf("piss water"); +" "[In]"ndia " printf("Heaven"); +" "[In]"ndian " printf("heavenly"); +"sacred cow" printf("God"); +silo printf("calfeteria"); +divin printf("bovin"); +[Gg][Oo-][Dd] printf("Bovinity"); +sheep printf("dog(s)"); +relaxing printf("chewing the cud"); +relax printf("chew the cud"); +utter printf("udder"); +" udder" printf(" teat"); +" teat" printf(" udder"); +other printf("udder"); +":^)" printf("Mooooooooo!"); +":-)" printf("Moomoomoomoo!"); +"8-)" printf("Mooo! Mooo!"); + +[aeiou]"." { *(yytext+1) = 0; + printf("%s. Moo.",yytext); + } +[rtpwy]"." { *(yytext+1) = 0; + printf("%s. Moo! Moo.",yytext); + } +"?" printf("? Moo."); +"!" printf("! MOO!"); +oo printf("MOO"); +o printf("oo"); +O printf("Moo"); +you printf("moo"); +" u" printf("moo"); +" U" printf("Moo"); +"uu" printf("MOOO"); +u printf("oo"); +U printf("Oo"); + +"."\n printf(".\nMooooo. "); + +. printf("%s",yytext); + +%% + +main() +{ + yylex(); +} + diff --git a/newspeak.l b/newspeak.l new file mode 100644 index 0000000..e291f6d --- /dev/null +++ b/newspeak.l @@ -0,0 +1,677 @@ +%{ -*- Mode:Fundamental -*- +/* + * newspeak.l, version 1.1. + * Lex filter to transform plain English into NewSpeak. + * Copyright (c) 1991 Jamie Zawinski . + * Permission granted for noncommercial use and redistribution. + * + * To compile: + * + * flex newspeak.l + * cc -O -o newspeak lex.yy.c + * rm lex.yy.c + * + * This must be compiled with "flex", not normal "lex". Lex has + * some builtin, unchangable limits which this program exceeds. + * This has been verified to work with flex version 2.3.7, and + * may not work with flex version 2.3.6. + * + * You can get 'flex' by anonymous FTP to prep.ai.mit.edu, or + * anywhere else you get GNU software. + * + * Run this like so: "newspeak < some-text-file | more" + * + * There are some design notes near the end. Suggestions and + * improvements to this code are more than welcome. + * Hail Big Brother! + *--------------------------------------------------------------------------- + */ +#include + +unsigned int fcounter = 0; + +#define Y0 yytext[0] +#define Y1 yytext[1] +#define Y2 yytext[2] +#define Y3 yytext[3] +#define C caseify +#define C1 caseify1 + +#define CAP(string) capstring(0, (string),0) +#define WCAP(string) capstring(Y0,(string),1) + +#define COMP(string1,string2) compstring(0, (string1),(string2),0) +#define WCOMP(string1,string2) compstring(Y0,(string1),(string2),1) + +#define DUMP() printf("%s",yytext) +%} + +%e 8000 +%p 9000 +%n 2000 +%k 3000 +%a 5000 +%o 4000 + +W (([ ]?\n[ ]*)|[ ]|[\"'`]) +ES [.,;:!?/] +EW ({W}|{ES}|"'") + +YOUNG (([Yy]oung|[Ss]mall|[Ll]ittle){W}) +DEAD (([Dd]ead|[Dd]eceased){W}) +THE ([Tt]he{W}?) +ANDOR ({W}(([Aa]nd)|([Oo]r)){W}?) +COLOR (red|green|blue|yellow|cyan|magenta|purple|orange|mauve|pink|turquoise|brown|gr[ae]y) + +%% + +%{ + /****************************** + * PLUSwords * + ******************************/ +%} + +[Qq]uite{EW}/[A-Za-z][A-Za-z] CAP("plus"); +[Rr]ather{EW}/[A-Za-z][A-Za-z][A-Za-z] CAP("plus"); +[Kk]ind{EW}of{EW}/[A-Za-z][A-Za-z][A-Za-z] CAP("plus"); +[Kk]inda{EW}/[A-Za-z][A-Za-z][A-Za-z] CAP("plus"); +[Mm]ore{W}than{W}a{W}(little|bit){W} CAP("plus"); +[Pp]ro- CAP("plus"); + +[Hh]undreds{W}of{W}[Tt]housands | +[Hh]undreds{ANDOR}[Tt]housands | +[Hh]undreds{W}if{W}not{W}[Tt]housands | +[Tt]housands | +[Mm]illions CAP("doubleplusmany"); + +[Dd]ozens CAP("many"); +[Hh]undreds CAP("plusmany"); + +([Bb]right|[Ll]ight|[Ii]ntense){W}/{COLOR} CAP("plus"); +([Dd]im|[Ff]aded|[Dd]ark|[Pp]ale){W}/{COLOR} CAP("plusun"); +([Dd]im|[Ff]aded|[Dd]ark|[Pp]ale) CAP("unlight"); + +[Ee]very DUMP(); +[Vv]ery{W} | +[Rr]eally{W} | +[Tt]erribly{W} | +[Aa]wesome({W})? | +[Aa]wfully{W} CAP("doubleplus"); + +[Ww]hopping{EW} CAP("plusbig"); + +"O.K." | +[Aa]ll({W})?[Rr]ight | +[Oo][Kk][Aa][Yy] CAP("plusgood"); +{W}OK/{W} WCAP("plusgood"); + +([Tt]oo|[Oo]verly|[Tt]hat){W}[Mm]uch CAP("plusmuch"); + +{W}[Bb]ad/{EW} WCAP("ungood"); +{W}[Pp]oor/{EW} WCAP("ungood"); +{W}[Ll]ame/{EW} WCAP("ungood"); +{W}[Pp]itiful/{EW} WCAP("ungood"); +{W}[Nn]asty/{EW} WCAP("plusungood"); +{W}[Hh]orrid/{EW} WCAP("doubleplus ungood"); +{W}[Hh]orrible/{EW} WCAP("doubleplus ungood"); +{W}[Aa]wful/{W} WCAP("doubleplus ungood"); +{W}[Ee]vil/{W} WCAP("doubleplus ungood"); + +%{ + /****************************** + * Titles * + ******************************/ +%} + +{W}[Ss]ir/{EW} WCAP("citizen"); +{W}[Mm]r"."/{EW} WCAP("brother"); +[Mm]ister/{EW} CAP("brother"); +[Mm]adame? CAP("sister"); +{W}[Mm]iss/{EW} WCAP("sister"); +[Mm]a"'"?am/{EW} CAP("sister"); +{W}[Mm]r?s"."/{EW} WCAP("sister"); +Mrs/{EW} CAP("sister"); + +{YOUNG}?[Cc]hildren CAP("young citizens"); +{YOUNG}?[Bb]oys{ANDOR}[Gg]irl/s CAP("young citizens"); +{YOUNG}?([Kk]id|[Gg]irl|[Bb]oy|[Cc]hild)/{EW} CAP("young citizen"); + +[Ff]ellow CAP("citizen"); + +[Nn]on{W}?"-"?citizen CAP("unperson"); +[Nn]on{W}?"-"?member CAP("unperson"); +[Cc]riminal/s? CAP("unperson"); +{DEAD}(man|woman) CAP("unperson"); +{DEAD}(men|women) CAP("unpersons"); + +[Ii]n{W}[Pp]erson DUMP(); + +{W}[Uu]ser WCOMP("party ","worker"); +[Ss]tudent COMP("party ","worker"); +[Cc]itizen/s?{EW} COMP("party ","worker"); +[Pp]erson/s?{EW} COMP("party ","worker"); +[Pp]eople COMP("party ","workers"); + +[Ss]enator | +[Cc]ongressman | +[Ss]upervisor | +[Pp]rofessor printf("Inner Party Member"); +[Pp]rof"."/{EW} printf("Inner Party Member"); +[Pp]rof/{EW} printf("Inner Party Member"); + +Representative/s? printf("Inner Party Member"); +representatives printf("Inner Party Members"); + +[Ww]hite{W}[Cc]ollar | +[Uu]pper{W}[Cc]lass COMP("inner ","party"); +[Mm]iddle{W}[Cc]lass CAP("party"); +[Bb]lue{W}[Cc]ollar | +[Ww]orking{W}[Cc]lass | +[Ll]ower{W}[Cc]lass CAP("prole"); +([Ff]ool|[Ii]diot)/s?{EW} CAP("prole"); +[Ss]tupidity CAP("proleness"); + +%{ + /****************************** + * Organizations * + ******************************/ +%} + +[Aa]?{W}([Ww]hite{W}[Hh]ouse|[Gg]ovt\.?|[Gg]overnment){W}([Ss]ource|[Oo]fficial|[Ss]pokes(man|woman|person)) CAP("an Inner Party Member"); +{THE}?[Rr]epublican{W}[Pp]arty COMP("mini","luv"); +{THE}?[Dd]emocratic{W}[Pp]arty COMP("mini","plenty"); + +{THE}?Congress printf("MiniPax"); +{THE}?[Ss]enate printf("MiniPax"); +{THE}?[Hh]ouse{W}[Oo]f{W}[Rr]epresentatives printf("MiniPax"); +{THE}?[Ss]tate{W}[Dd]epartment printf("MiniPax"); +{THE}?[Ss]tate{W}[Dd]ept"."? printf("MiniPax"); +{THE}?[Dd]efen[cs]e{W}[Dd]epartment | +{THE}?[Dd]efen[cs]e{W}[Dd]ept"."? | +{THE}?[Ww]ar{W}[Dd]epartment | +{THE}?[Ww]ar{W}[Dd]ept"."? | +{THE}?[Hh]ouse{W}of{W}[Cc]ommons | +{THE}?Pentagon | +{THE}?[Ff]eds | +{THE}?FCC | +{THE}?D[Oo]D | +{THE}"D."[Oo]".D." | +{THE}?[Ss]ecret{W}[Ss]ervice COMP("mini","luv"); +{THE}?White{W}House | +{THE}?Kremlin printf("MiniTrue"); +{THE}?(CIA|NSA|FBI|MI"-"?5)/{EW} printf("MiniTrue"); +{THE}?("C.I.A."|"N.S.A."|"F.B.I.")/{EW} printf("MiniTrue"); +{THE}?[Aa]rchive/s? COMP("mini","rec"); +{THE}?[Ll]ibrary COMP("mini","rec"); +{THE}?[Ll]ibraries COMP("mini","recs"); + +[Tt]hought{W}[Pp]olice|[Nn]azis? COMP("think","pol"); +[Vv]ice{W}[Ss]quad COMP("sex","pol"); +PMRC|"P.M.R.C." COMP("sex","pol"); + +[Oo]fficer CAP("minister"); + +{THE}?[Dd]epartment{EW}of{EW}. | +{THE}?[Dd]ept"."?{EW}of{EW}. | +{THE}?[Uu]niversity{EW}of{EW}. | +{THE}?[Uu]niv"."?{EW}of{EW}. | +{THE}?[Dd]ept"."?{EW}of{EW}. | +{THE}?([Ss]ub"-"?)?[Cc]omm?itt?ee{EW}(of|on){EW}. | +{THE}?[Ss]chool{EW}of{EW}. { + if ((yytext[yyleng-1] >= 'A') && (yytext[yyleng-1] <= 'Z')) + /* "the school of Law" --> "MiniLaw" */ + printf("Mini%c",yytext[yyleng-1]); + else if ((yytext[yyleng-1] >= 'a') && (yytext[yyleng-1] <= 'z')) + /* "the school of law" --> "MiniLaw" (not "Minilaw") */ + printf("Mini%c",yytext[yyleng-1] - ('a' - 'A')); + /* "the school of 5 things" --> "Ministry of 5 things" */ + else printf("Ministry of %c",yytext[yyleng-1]); + } + +[Dd]epartment | +[Uu]niversity CAP("ministry"); +[Uu]niv"."?/{W} CAP("ministry"); +[Dd]ept"."?/{W} CAP("ministry"); +([Ss]ub"-"?)?[Cc]omm?itt?ee CAP("ministry"); + +{THE}[Pp]roject/{EW} CAP("the Three Year Plan"); +[Oo]ur{W}[Pp]roject/{EW} CAP("our Three Year Plan"); +[Bb]udget printf("Three Year Plan"); +[Pp]roject/{ES} printf("Three Year Plan"); + +{W}({THE}|([aa]{W}))[Pp]roject printf("%cthe Three Year Plan",Y0); + +[A-Za-z]+"'"[Ss]/{W}(law|Law|LAW|book|Book|BOOK|rule|Rule|RULE){EW} printf("Goldstein's"); + +%{ + /****************************** + * Actions * + ******************************/ +%} + +[Ii]n{W}love{EW} CAP("SexCriming"); +[Ll]ove{W}you/{EW} CAP("love Big Brother"); +[Ll]ove{W}me/{EW} CAP("love Big Brother"); + +[Cc]loning | +[Rr]eproduction | +[Cc]elibacy | +[Pp]rocreation COMP("good","sex"); + +[Cc]elibate | +[Pp]rocreate COMP("good","sexwise"); + +[Tt]elevisions? | +TVs? | +[Tt]"."[Vv]"."s? | +[Rr]adios? | +[Nn]ews{W}?[Pp]apers? | +[Jj]ournalism | +[Mm]ovies? | +[Rr]ock{EW}?"-"?(and|"&"|"'"?n"'"?){EW}?"-"?[Rr]oll({W}[Mm]usic)? | +(([Rr]ock|[Cc]lassical|[Ii]ndustrial|[Pp]op|[Dd]ance|[Rr]ap){W})?[Mm]usic | +[Tt]unes | +[Mm]oney | +[Cc]ash | +[Cc]omic{W}[Bb]ooks? | +([Ss]tar{W}?)?[Tt]rek COMP("prole","feed"); + +[Pp]eace{W}[Mm]ovement | +[Pp]eace{W}[Pp]rotest | +[Aa]nti{EW}[Ww]ar | +([Pp]assive{W})?[Rr]esistance | +[Cc]reativity | +[Tt]reason | +[Rr]esearch COMP("crime","think"); +%{ + /****************************** + * Religion * + ******************************/ +%} + +[Jj]esus{W}[Cc]hrist | +[Jj]esus | +{THE}?[Bb]uddh?a | +[Mm]ohamm?ed | +[Mm]artin{W}[Ll]uther{W}[Kk]ing | +J\.?\ ?R\.?\ \"?Bob\"?\ Dobbs printf("doubleplus crimethinker"); + +([Jj]esse{W})?[Hh]elms | +([RrDd]on(ald)?{W})?[Rr]ea?gan | +[Gg]eorge{W}[Gg]uscoria printf("doubleplus goodthinker"); + +[Jj]ewish COMP("crime","thinkwise"); +[Jj]ew | +[Cc]hristian | +[Mm]oslem | +[Bb]uddhist | +[Aa]thiest | +[Aa]gnostic COMP("crime","thinker"); + +[Ff]aith COMP("belly","feel"); + +%{ + /****************************** + * Places * + ******************************/ +%} + +[Ee]ngland|{THE}?[Uu]nited{W}[Kk]ingdom | +({THE}?[Uu]nited{W}[Ss]tates{W}[Oo]f{W})?[Aa]merica | +{THE}?[Uu]nited{W}[Ss]tates|USA|"U.S.A."|[Cc]anada | +[Gg]ermany|[Ii]srael|[Ee]urope printf("Oceana"); + +Iranian|Iraqu?i|Libyan|Russian|African|Egyptian printf("Eurasian"); +Iran|Iraq|Libya|Russia|Africa|Egypt | +([Ss]audi{W})?Arabia|{THE}?Soviet{W}Union printf("Eurasia"); +[Ss]oviet printf("Eurasian"); + +[Cc]hinese|[Jj]apanese|[Tt]aiwanese | +[Pp]hillipino|[Ii]ndian|[Aa]ustralian|[Mm]exican | +[Nn]icaraguan|[Ss]alvadori?an printf("Eastasian"); +China|[Jj]apan|[Tt]aiwan|{THE}?[Pp]hillipines|[Ii]ndia | +[Aa]ustralia|[Mm]exico|[Nn]icaragua|[Ee]l{W}[Ss]alvador printf("Eastasia"); + +[Kk]uwaiti printf("Eurasian"); +[Kk]uwait printf("The Malabar Front"); + +%{ + /****************************** + * Miscelaneous Translations * + ******************************/ +%} + +{W}[Ff]aster WCAP("plus speedful"); +{W}[Ss]lower WCAP("plus unspeedful"); +{W}[Ff]ast WCAP("speedful"); +{W}[Ss]low WCAP("unspeedful"); + +[Mm]odern CAP("plusnew"); +[Aa]ncient CAP("plusunnew"); +{W}old/{W} WCAP("plusunnew"); + +[Hh]appiness CAP("joyfulness"); +[Hh]appy CAP("joyful"); +[Qq]uick CAP("speedful"); +{W}[Ss]peedy WCAP("speedful"); +[Hh]eavy CAP("weightful"); +[Hh]eavill?y CAP("weightfully"); +[Ss]ick(ly)? CAP("unhealthful"); + +[Gg]ross | +[Ss]ickening | +[Ff]oul | +[Pp]utrid | +[Dd]isgusting COMP("crime","thinkful"); + +[Ss]mash | +[Cc]rush | +[Oo]bliterate | +[Aa]nnihilate | +[Nn]eutralize | +[Dd]emolish | +[Dd]estroy CAP("unbuild"); + +[Ii]nanimate CAP("unlifeful"); +[Ss]ociety|[Cc]ulture printf("IngSoc"); +[A-Za-z]+isi?m/{EW} printf("Goldsteinism"); +[A-Za-z]+ist/{EW} printf("Goldsteinist"); + +{W}[Dd]ead WCAP("unlifeful"); +{W}[Dd]eath WCAP("unlife"); +{W}[Ll]ie WCAP("untruth"); +{W}[Ff]alsehood WCAP("untruth"); +{W}[Mm]istake/{EW} WCAP("untruth"); +{W}[Ww]hisper WCAP("unshout"); +{W}[Pp]roud WCAP("prideful"); + +[Ff]alse CAP("untrue"); +[Dd]ark CAP("unlight"); +[Bb]lack CAP("unwhite"); +[Ff]orbidden CAP("unallowed"); +[Ff]orbid CAP("unallow"); +[Ff]ailure CAP("unsuccess"); +[Ff]ail/{EW} CAP("unwin"); + +[Ss]tatistics?/{EW} CAP("propaganda"); +{W}[Aa]n{W}[Aa]nn?ouncement WCAP("a NewsFlash"); +[Aa]nn?ouncement printf("NewsFlash"); +[Ii]nstructions? printf("B. B. DayOrder"); + +[Aa]lmost|[Nn]early CAP("within measurable distance of"); +[Ff]unny CAP("humorful"); + +[Dd]oom CAP("unsave"); +[Cc]haos CAP("unorder"); +[Cc]haotic CAP("unorderful"); +[Ee]nslaved CAP("protected"); +[Ee]nslave CAP("protect"); +[Dd]angerous CAP("unsafewise"); +[Dd]anger CAP("unsafe"); +([Bb]lind{W})?[Oo]bedience COMP("ing","soc"); +\"?[Nn]ew{W}[Ww]orld{W}[Oo]rder\"? printf("IngSoc"); + +[Pp]rivacy | +[Ii]ndividuality COMP("own","life"); + +IMHO printf("for the love of Big Brother"); + +[Ee]motion(al|s)? | +[Cc]onviction | +[Bb]elie(f|ve) | +[Aa]ccept(ance)? COMP("belly","feel"); + +[Dd]emocracy | +[Ll]iberty | +[Ff]reedom | +[Jj]ustice | +{THE}?[Aa]merican{W}[Ww]ay | +[Ss]ubversion | +[Pp]assion COMP("crime","think"); + +[Oo]bscenity | +[Pp]ornography | +[Oo]rgasm | +[Ee]rotica COMP("sex","crime"); +[Ss]exy | +[Oo]bscene | +[Pp]ornographic | +[Ee]rotic COMP("sex","crimeful"); + +[Cc]ritic/s?{W} COMP("crime","thinker"); + +[Ii]nfant{W}[Mm]ortality COMP("inf","mort"); + +[Ff]amilies | +[Pp]arents COMP("family ","units"); +[Mm]other{ANDOR}[Ff]ather | +[Bb]rother{ANDOR}[Ss]ister COMP("family ","unit"); +{W}[Pp]arent/s?{EW} WCOMP("family ","unit"); +[Ff]amily COMP("family ","unit"); + +God/{EW} printf("Big Brother"); +[Pp]res(ident|".")({W}([Bb]ush|[Rr]eagan))? printf("Big Brother"); +[Pp]rime{W}[Mm]inister printf("Big Brother"); + +([Gg][Nn][Uu]{W}([Ee]macs|EMACS){W})?[Gg]eneral{W}[Pp]ublic{W}[Ll]icense printf("NewSpeak Dictionary"); + +(questioning|murder|ass?ass?ination)/{ES} printf("interrogation"); + +[Ss]keptic/{EW} CAP("unperson"); +[Ss]illy CAP("foolhardy"); +{W}[A-Za-z][A-Za-z]?illy DUMP(); +[Ss]outhern|[Ss]outherly CAP("southwise"); +[Nn]orthern|[Nn]ortherly CAP("northwise"); +[Ee]astern|[Ee]easterly CAP("eastwise"); +[Ww]estern|[Ww]esterly CAP("westwise"); +[Pl]leasant CAP("goodwise"); +[Vv]iolent CAP("unpeacewise"); +[Vv]iolence CAP("unpeaceness"); +[Ii]ndifference CAP("uncarefulness"); +[Ii]ndifferent CAP("uncareful"); +[Bb]elly CAP("abdomen"); +[Cc]omic CAP("humorwise"); +{W}[Uu]nless WCAP("lest"); +usually printf("usualwise"); + +[Gg]uerillas COMP("party ","workers"); + +[Ww]ar/{EW} CAP("engagement"); +[Dd]efen[cs]e/{EW} CAP("peace"); +[Ii]nvasion CAP("liberation"); + +%{ + /****************************** + * Syllable Rewriting * + ****************************** + isn't ___ is un___ + not the ___ the un___ + not my ___ my un___ + anti___ un___ (etc...) + ___cally ___wise + ___ally ___wise + ___lly ___wise + ___ly ___wise + ___aic ___wise + ___lic ___wise + ___nnic ___wise + tric ___wise + ___ic ___wise + ous ___ful + ous ___eful + ___less un___ful + + */ +%} + +[Ii]sn"'"t{W}my{W} CAP("is my un"); +[Ii]s{W}not{W}my{W} CAP("is my un"); +[Ii]sn"'"t{W}[Tt]he{W} CAP("is the un"); +[Ii]s{W}not{W}[Tt]he{W} CAP("is the un"); +[Ii]sn"'"t{W}[Ii]n{W}[Tt]he{W} CAP("is in the un"); +[Ii]s{W}not{W}[Ii]n{W}[Tt]he{W} CAP("is in the un"); +[Ii]t"'"?s{W}not{W}[Tt]he{W} CAP("it's the un"); +[Ii]sn"'"t{W} CAP("is un"); +[Ii]s{W}not{W} CAP("is un"); +[Nn]ot{W}[Tt]he{W} CAP("the un"); +[Nn]ot{W}[Mm]y{W} CAP("my un"); +[Nn]ot{W}[Aa]{W} CAP("an un"); +[Nn]ot{W}have{W} CAP("has un"); +[Nn]ot{W}be{W} CAP("be un"); +[Nn]ot{W}[Oo]nly/{W} CAP("unonly"); /* avoid "unonwise" */ + +[Aa]{W}[Nn]ot{W} | +[Aa]{W}[Nn]on"-"? printf("%cn%cun",Y0,Y1); /* "a non_" -> "an un_" */ + +%{ +/* {W}[Nn]ot{W} | */ +%} +{W}[Ii]l"-"?/[a-z][a-z] WCAP("un"); +{W}[Aa]nti"-"? | +{W}[Nn]on"-"? WCAP("un"); + +robably|ventually|[Oo]bvious|[Bb]asic|{W}[Oo]nly|otally | +[Aa]rctic|holic|{EW}ally|{EW}[Aa]pply|{W}[Tt]opic DUMP(); + +{W}([Tt]raf|[Pp]aci|[Ss]peci)fi/c{W} DUMP(); +{W}(ma|tra)gi/c{W} DUMP(); +{W}(pub|cyc|re|fro|gar)li/c{W} DUMP(); +{W}(eth|cli|to)ni/c{W} DUMP(); +{W}(E|cle|met|cit)ri/c{W} DUMP(); +{W}(ch|ep|tr?op|t|mus|stat|att)i/c{W} DUMP(); +{W}only/{W} DUMP(); +{W}[Aa]tlantic DUMP(); + +[ \t\n][drstwDRSTW]ally printf("%c%cally", Y0, Y1); + +[a-z]ically/{W} printf("%cwise", Y0); +[a-z]ally/{W} printf("%cwise", Y0); +[a-z][a-z]lly/{W} printf("%c%cwise", Y0,Y1); +[a-z][a-z][a-z]ly/{W} printf("%c%c%cwise", Y0,Y1,Y2); +[a-z]ical/{W} printf("%cwise", Y0); + +[a-km-qs-z]aic/{EW} printf("%cwise", Y0); /* not laic, raic */ +[a-z]lic/{EW} printf("%clwise", Y0); +[a-z]nnic/{EW} printf("%cnwise", Y0); +[a-z][aeiou]tric/{EW} printf("%c%ctwise", Y0, Y1); +[a-z]tric/{EW} printf("%cwise", Y0); +[a-z]ic/{EW} printf("%cwise", Y0); +[a-z]lly/{EW} printf("%cwise", Y0); +[a-z]ly/{EW} printf("%cwise", Y0); + +[aeiouy][^aeiouy]ous/{EW} printf("%c%cful",Y0,Y1); +[^aeiouy]ous/{EW} printf("%ceful",Y0); +[^e]ous/{EW} printf("%cful",Y0); + +[A-Za-z]+less/{EW} { yytext[yyleng-4] = '\0'; + if (((yytext[1] < 'A') || (yytext[1] > 'Z')) && + (yytext[0] >= 'A') && (yytext[0] <= 'Z')) + yytext[0] = yytext[0] - ('a' - 'A'); + printf("%cn%sful",C('u'), yytext); + } + +". " { printf("%s",yytext); + fcounter &= 15; + if (14 == fcounter++) printf("(fnord) "); + } + +[.,!?]\"([^\n\".!]+[.!])?\n/[\n\t ] printf("%c Hail Big Brother!\"%s",Y0,yytext+1); +\"([.,!?][^\n\".!]+[.!])?\n/[\n\t ] printf("%c Hail Big Brother!\"%s",Y1,yytext+2); + +. printf(yytext); +\n printf("\n"); + +%{ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Brief description of Orwell's NewSpeak: + * --------------------------------------- + * Each word was made to serve as noun, verb, adjective and adverb. In + * particular, nouns and verbs were made exactly the same -- hence "think" + * replaced "thought" as a noun (viz. "crimethink" = thought crime, "thinkpol" + * = thought police). Adjectives were formed by adding "-ful" to a noun/verb; + * adverbs were formed by adding "-wise." Hence "speedful" = fast, + * "speedwise" = quickly, "unspeedwise" = slowly. + * + * The decision on which word should be negated was made fairly randomly; + * "dark" could be "unlight," or "light" could be "undark". But in all cases + * the most important objective (aside from ideological restriction) was + * euphony; the words had to be easily pronounceable. + * + * Most verb inflections were made regular; "he thinked," "he goed," "he + * eated"; only the auxiliaries and modals (to be, to have, may, shall, will, + * etc.) were allowed to inflect irregularly. Plurals were also regularized: + * "mans," "oxes," "childs." [This isn't implemented here.] + * + * There were three sets of words. The A vocabulary was for everyday use: + * car, man, red, good, etc. It was restricted to fairly simple words. + * + * The B vocabulary consisted of political/ideological words with very + * complicated connotations. All of the B words were compound words -- + * bellyfeel (blind emotional acceptance of the ideology), oldthink (the way + * of thought before the Revolution), crimethink, Ingsoc, goodsex (intercourse + * solely for the purpose of making babies and with no physical enjoyment on + * the part of the female), sexcrime (any kind of sex but goodsex, including + * sex for its own sake), goodthink (thinking in accordance with Ingsoc), and + * so on. These words were also subject to the modifications mentioned + * above--hence "goodthinker," "goodthinkful," "goodthinkwise." + * + * The C vocabulary consisted of scientific and technical words (though there + * was no longer any word for "science," any connotation it might have being + * subsumed into "Ingsoc"). + * + * Implementing a translator for all of this would be really complicated -- + * I'd need rather extensive lists of the "irregular" words (so they could be + * regularized), as well as lists of politically meaningful words (so they + * could be excised or translated into either "goodthink" or "crimethink," as + * appropriate). Any kind of sexual topic should become "sexcrime" (it being + * unlikely that any talk of sex these days would fit into "goodsex"). + * + * Basically, the reason it's hard is that NewSpeak was intended to *decrease* + * the vocabulary, and subsume complicated ideas into politically correct + * words so that you wouldn't have to understand the ideas anymore; you'd just + * have to emit the right words. So to properly "translate" anything into + * NewSpeak, you have to cut the vocabulary way down. + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + */ +%} + +%% +main() +{ + yylex(); + printf("\nHail Big Brother!\n"); +} + + +capstring(firstchar,string,i) + char firstchar, *string; + int i; +{ + if (firstchar != 0) putchar(firstchar); + putchar( (yytext[i] <= 'Z') ? (string[0] - ' ') : string[0]); + printf("%s",string+1); +} + +compstring(firstchar,string1,string2,i) + char firstchar, *string1, *string2; + int i; +{ + capstring(firstchar,string1,i); + capstring(0,string2,i); +} + +_caseify(c,i) + char c; + int i; +{ + if (yytext[i] <= 'Z') return (c - ' '); + else return (c); +} + +caseify(c) + char c; +{ _caseify(c,0); } + +caseify1(c) + char c; +{ _caseify(c,1); } diff --git a/nyc.l b/nyc.l new file mode 100644 index 0000000..8505c16 --- /dev/null +++ b/nyc.l @@ -0,0 +1,97 @@ +%{ +/* + * Lex filter to transform plain English into Brooklyn English. + * No racial or societal slurs are intended. For amusement only. + * + * Copyright 1986 by Daniel Klein. + * + * Reproduction permitted so long as this notice is retained. + */ +%} +BW [ \t] +SP [ \t] +EW [ \t.,;!\?$] +%% +".so ".*$ printf("%s", yytext); +[ao]ther printf("%cdder", yytext[0]=='a'?'a':'u'); +[Nn]othing printf("%cuttin'", yytext[0]); +[Tt]hin printf("%cin", yytext[0]); +[Tt]hir printf("%coi", yytext[0]); +[Tt]h[ei] printf("%c%c", caseify('d'), yytext[yyleng-1]); +[Tt]hat printf("%cat", caseify('d')); +I'm{SP}going{SP}to printf("I'manna"); +going{SP}to printf("gonna"); +want{SP}to printf("wanna"); +t{SP}you printf("tcha"); +[Dd]id{SP}you{SP}[eaiou] printf("%c'j%c", yytext[0], yytext[yyleng-1]); +[Dd]id{SP}you printf("%c'ja", yytext[0]); +[Yy]ou printf("%cuh", yytext[0]); +[Hh]ow{SP}are{SP}you printf("%cowahrya", yytext[0]); +[Ww]ith printf("%cit'", yytext[0]); +[Dd]on't printf("%coan", yytext[0]); +ldn't | +dn't printf("n't"); +isn't printf("ain't"); +er{EW} { printf("uh"); plastc(); } +ing{EW} { printf("in'"); plastc(); } +[Ww]ord | +[Hh]eard | +[BbGgLlPpSs]urg | +[CcHh][eu]r[ntv] printf("%coi%c", yytext[0], yytext[yyleng-1]); +[^Mm]mer[^aeiouhrs] printf("%cmoi%c", yytext[0], yytext[yyleng-1]); +[Oo]re{EW} { printf("%cwh", caseify('a')); plastc(); } +[Oo]r printf("%cwh", caseify('a')); +[Oo]f printf("%chv", caseify('u')); +tion printf("shun"); +alk | +our[st] | +or[st] printf("awh%c", yytext[yyleng-1]); +ause printf("awze"); +[Oo]ff printf("%cwhf", caseify('a')); +[Ss]tupid printf("%ctoopid", yytext[0]); +{BW}under printf(" unner"); +{BW}to{EW} { printf(" tuh"); plastc(); } +[Aa]ctual printf("%cckshul", yytext[0]); +negro printf("spade"); +[Pp]uerto{SP}[Rr]ican printf("%cpic", caseify('s')); +[Ii]talian printf("%creaser", caseify('g')); +[Jj]ewish printf("%cew boy", yytext[0]); +[Jj]ew printf("%cebe", caseify('h')); +[a-z]":" { *(yytext+1) = ','; + printf("%s like, uhh:",yytext); + } +[a-z]"?" { *(yytext+1) = ','; + printf("%s or what?",yytext); + } +! printf("! Okay?"); +[a-z]"." { printf("%s", yytext);expletive();} +%% +plastc() +{ + unput(yytext[yyleng-1]); +} + +caseify(c) +char c; +{ + if (yytext[0] <= 'Z') + return (c - ' '); + else + return (c); +} + +short count = 0; +short which = 0; + +expletive() +{ + if (count++ % 4 == 0) { + switch (which++ % 5) { + case 0: printf(" Okay?"); break; + case 1: printf(" Right?"); break; + case 2: printf(" Yuh got me so fahr?"); break; + case 3: printf(" Ya' dig?"); break; + case 4: printf(" Yuh with me?"); break; + } + } +} diff --git a/upside-down b/upside-down new file mode 100755 index 0000000..c4aa7e0 --- /dev/null +++ b/upside-down @@ -0,0 +1,3 @@ +#!/usr/bin/perl -pl- +$_=reverse lc$_;s@"@''@g;y/[]{A-R}<>()a-y1-9,!.?`'/][} Joey Hess +{><)(eq)paj6y!fk7wuodbjsfn^mxhl5Eh29L86`i'%,/;s@k@>|@g# joey@kitenet.net diff --git a/valspeak.l b/valspeak.l new file mode 100644 index 0000000..d177d78 --- /dev/null +++ b/valspeak.l @@ -0,0 +1,134 @@ + +T [" .!?,"]* + +%% + +" bad" printf(" mean"); +" big" printf(" bitchin'est"); +" body" printf(" bod"); +" bore" printf(" drag"); +" car " printf(" rod "); +" dirty" printf(" grodie"); +" filthy" printf(" grodie to thuh max"); +" food" printf(" munchies"); +" girl" printf(" chick"); +" good" printf(" bitchin'"); +" great" printf(" awesum"); +" gross" printf(" grodie"); +" guy" printf(" dude"); +" her " printf(" that chick "); +" her." printf(" that chick."); +" him " printf(" that dude "); +" him." printf(" that dude."); +" can be " | +" can't be " | +" should have been " | +" shouldn't have been " | +" should be " | +" shouldn't be " | +" was " | +" wasn't " | +" will be " | +" won't be " | +" is " { + ECHO; + switch(rand() % 6) + { + case 0: + printf("like, ya know, "); break; + case 1: + printf(""); break; + case 2: + printf("like wow! "); break; + case 3: + printf("ya know, like, "); break; + case 4: + printf(""); break; + case 5: + printf(""); break; + } + } +" house" printf(" pad"); +" interesting" printf(" cool"); +" large" printf(" awesum"); +" leave" printf(" blow"); +" man " printf(" nerd "); +" maybe " { + switch(rand() % 6) + { + case 0: + printf(" if you're a Pisces "); break; + case 1: + printf(" if the moon is full "); break; + case 2: + printf(" if the vibes are right "); break; + case 3: + printf(" when you get the feeling "); break; + case 4: + printf(" maybe "); break; + case 5: + printf(" maybe "); break; + } + } +" meeting" printf(" party"); +" movie" printf(" flick"); +" music " printf(" tunes "); +" neat" printf(" keen"); +" nice" printf(" class"); +" no way" printf(" just no way"); +" people" printf(" guys"); +" really" printf(" totally"); +" strange" printf(" freaky"); +" the " printf(" thuh "); +" very" printf(" super"); +" want" printf(" want"); +" weird" printf(" far out"); +" yes" printf(" fer shure"); +"But " printf("Man, "); +"He " printf("That dude "); +"I like" printf("I can dig"); +"No," printf("Like, no way,"); +Sir printf("Man"); +"She " printf("That fox "); +This printf("Like, ya know, this"); +There printf("Like, there"); +"We " printf("Us guys "); +"Yes," printf("Like,"); +", " { + switch(rand() % 6) + { + case 0: + printf(", like, "); break; + case 1: + printf(", fer shure, "); break; + case 2: + printf(", like, wow, "); break; + case 3: + printf(", oh, baby, "); break; + case 4: + printf(", man, "); break; + case 5: + printf(", mostly, "); break; + } + } +! { + switch(rand() % 3) + { + case 0: + printf("! Gag me with a SPOOOOON!"); break; + case 1: + printf("! Gag me with a pitchfork!"); break; + case 2: + printf("! Oh, wow!"); + } + } + +ing printf("in'"); +. ECHO; +%% + +main() +{ + srand(getpid()); + yylex(); +}