home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sources.misc
- From: Whitten@Fwva.Saic.Com (David Whitten)
- Subject: v37i032: b1ff - clueless newbie text filter, Part01/01
- Message-ID: <1993Apr28.045114.23839@sparky.imd.sterling.com>
- X-Md4-Signature: c8b08535936b4e3c63020b310e601a49
- Date: Wed, 28 Apr 1993 04:51:14 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: Whitten@Fwva.Saic.Com (David Whitten)
- Posting-number: Volume 37, Issue 32
- Archive-name: b1ff/part01
- Environment: UNIX
-
- Here's the latest version of B1FF!!!
- written by Matt, and modified by me (David Whitten)
- I'm losing net access, so maybe someone will enjoy this...
-
- Dave Whitten
- #---------------cut here------------------
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # Contents: README Makefile b1ff.l
- # Wrapped by kent@sparky on Tue Apr 27 23:47:05 1993
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 1 (of 1)."'
- if test -f 'README' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'README'\"
- else
- echo shar: Extracting \"'README'\" \(349 characters\)
- sed "s/^X//" >'README' <<'END_OF_FILE'
- XThis programs should work on any flavour of UNIX which has 'lex'.
- X
- Xb1ff:
- Xwill turn English into B1FFSTER speech, guaranteed to confuse and entertain.
- X
- XTo create it in the current directory, type
- X
- Xmake b1ff
- X
- XUse
- X cat [file_of_text] | b1ff | more
- Xor
- X man [command] | b1ff | more
- Xfor endless hours of fun.
- X
- X
- XMake copies if you want etc.etc.
- X
- END_OF_FILE
- if test 349 -ne `wc -c <'README'`; then
- echo shar: \"'README'\" unpacked with wrong size!
- fi
- # end of 'README'
- fi
- if test -f 'Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Makefile'\"
- else
- echo shar: Extracting \"'Makefile'\" \(219 characters\)
- sed "s/^X//" >'Makefile' <<'END_OF_FILE'
- X#Makefile for b1ff
- X
- X#Put in your favourite lex or C compiler here
- XLEX = lex
- XCC = cc
- X
- XCLIBS = -ll
- XCFLAGS = -O -s
- XRM = /bin/rm
- X
- Xb1ff: b1ff.l
- X $(LEX) b1ff.l
- X $(CC) $(CFLAGS) -o b1ff lex.yy.c $(CLIBS)
- X $(RM) -f lex.yy.c
- END_OF_FILE
- if test 219 -ne `wc -c <'Makefile'`; then
- echo shar: \"'Makefile'\" unpacked with wrong size!
- fi
- # end of 'Makefile'
- fi
- if test -f 'b1ff.l' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'b1ff.l'\"
- else
- echo shar: Extracting \"'b1ff.l'\" \(8168 characters\)
- sed "s/^X//" >'b1ff.l' <<'END_OF_FILE'
- X%{
- X/*
- X
- XFor the information of some:
- X
- XB1FF is a fictitious person who is "new" on the 'net.
- X
- XYou can recognize his posts by:
- X
- X He always SHOUTS as he types.
- X
- X He sometimes spells FONET1KLEE (phonetically) the rest of the time, he
- X just misspells words or punctuates them incorrectly.
- X
- X He shortens some words (presumably for ease in typing)
- X like '4' for 'for' or 'four'
- X like '2' for 'two' or 'to' or 'too'
- X like '&' for 'and'
- X like 'U' for 'you' or 'ewe'
- X like 'R' for 'are'
- X like 'C' for 'sea' or 'see'
- X
- XHe can't see the difference between certain letters
- X like '1' and 'i'
- X or like '0' and 'o'
- X or like '5' and 's'
- X or like '2' and 'z'
- X
- X His speech is peppered with profanity.
- X
- X He never uses only one '!' or '?' when '!!!!!!!!' or '????!!!!' will do.
- X
- X He never uses the apostrophe (') and always uses the double quote (")
- X instead.
- X
- X I have some vague memory of B1FF being mentioned in the New Hackers
- Xdictionary, but I can't verify the validity of this.
- X
- X I can't even validate that his full name is NELSON 0TB1FF , but it sounds
- Xcorrect.
- X*/
- X
- X/*
- XHere's the promised and long-awaited 'b1ff.x' English->B1FF converter
- Xthat everyone's been clamoring for. I made a few small changes since the
- Xlast version and made sure that it compiled correctly.
- X
- XTo compile this, save it to the file 'b1ff.x' and execute the following
- Xtwo commands:
- X lex b1ff.x
- X cc -o B1ff lex.yy.c -ll
- X
- XNote that the flags on cc should be in that order. You'll end up with the
- Xexecutable 'B1ff' (if you call it 'biff' with a lowercase 'b' you'll
- Xconflict with the biff mail-checking program).
- X
- XSend me any bugs or patches; I'm good friends with B1FF and since this is
- Xthe first program he's ever posted to the net, he wants to know if you
- Xhave any problems.
- X
- Xmdw
- X*/
- X /*
- X * B1FF.X by Matt Welsh (mdw@tc.cornell.edu) +1 607 253 2737
- X * modified and improved by David Whitten
- X *
- X * $Id: b1ff.x,v 1.1 92/11/03 18:31:10 mdw Exp Locker: mdw $
- X * $What: <@(#) b1ff.x,v 1.13> $
- X *
- X * Simulates our favorite guy, the B1FFSTER!!!!1!!!
- X *
- X * To compile, do the following:
- X *
- X * lex b1ff.x
- X * cc -o B1ff lex.yy.c -ll
- X *
- X * Yes, this is very poorly written, and yes, it was a late-night hack.
- X * But it seems to work, mail me if it doesn't compile, or if you find
- X * any bugs or make any additions.
- X * Happy B1FFing,
- X *
- X * mdw
- X *
- X */
- X
- X char buf[128];
- X%}
- X
- X
- XBW [ ]
- XEW [ .,;!?]
- XWC [A-Za-z']
- XNW [^A-Za-z']
- X
- X%start INW NIW
- X%e 3000
- X%p 6000
- X%n 1000
- X%k 500
- X%a 4000
- X%o 15000
- X
- X%%
- X
- X\\[^ \n]+ ECHO;
- X
- X{NW} { BEGIN NIW; ECHO; }
- X"..." { BEGIN NIW;
- X printf((rand()%2) ? "...C00L HUH!?! " : "...!! "); }
- X"."/{NW} { BEGIN NIW; printf((rand()%2) ? "." : "!!" ); }
- X".\"" { BEGIN NIW; printf((rand()%2) ? "!!!\"" : "!1!!\"" ); }
- X"!"$ { BEGIN NIW; printf("!!!!!!!!!!1"); }
- X"!"+/{NW} { BEGIN NIW; printf("!1!"); }
- X"?"/{NW} { BEGIN NIW; printf("??!!"); }
- X"?" { BEGIN NIW; printf("?!"); }
- X":)" { BEGIN NIW; printf(";-)!!! "); }
- X"8)" { BEGIN NIW; printf(";-)!!! "); }
- X":*)" { BEGIN NIW; printf(";-)!!!! "); }
- X":-)" { BEGIN NIW; printf(";-)!!!! "); }
- X"'" { BEGIN NIW; printf("\""); }
- X
- X"ove" { BEGIN INW; printf("UV "); }
- X"move" { BEGIN INW; printf("MOOV"); }
- X"ea" { BEGIN INW; printf("EE"); }
- X"ies" { BEGIN INW; printf("YS"); }
- X"please" { BEGIN INW; printf("PLEEZ!"); }
- X"Please" { BEGIN INW; printf("PLEEZ"); }
- X"Thanks" { BEGIN INW; printf("THANX!!"); }
- X"thanks" { BEGIN INW; printf("THANX"); }
- X"enough" { BEGIN INW; printf("ENUF"); }
- X"Enough" { BEGIN INW; printf("ENUFF"); }
- X"does" { BEGIN INW; printf("DUZ"); }
- X"Does" { BEGIN INW; printf("DUZ"); }
- X"fuck"/{NW} { BEGIN INW; printf("FUCK !!!!!1 "); }
- X"Fuck"/{NW} { BEGIN INW; printf("FUCK !!!!!1 "); }
- X"damn" { BEGIN INW; printf("FUCK!! "); }
- X<NIW>"hell"/{NW} { BEGIN INW; printf("FUCK!! "); }
- X"Damn" { BEGIN INW; printf("FUCK!! "); }
- X"Shit" { BEGIN INW; printf("FUCK!! "); }
- X"shit" { BEGIN INW; printf("FUCK!! "); }
- X<NIW>"Hell"/{NW} { BEGIN INW; printf("FUCK!! "); }
- X<NIW>"dick"/{NW} { BEGIN INW; printf("FUCK!! "); }
- X<NIW>"Dick"/{NW} { BEGIN INW; printf("FUCK!! "); }
- X<NIW>"mad"/{NW} { BEGIN INW; printf("PISSED 0FF!!!1! "); }
- X<NIW>"Mad"/{NW} { BEGIN INW; printf("PISSED 0FF!!!1! "); }
- X"ar"/{NW} { BEGIN NIW; printf("RE"); }
- X"are"/{NW} { BEGIN INW; printf("R"); }
- X"ain"/{NW} { BEGIN NIW; printf("ANE"); }
- X"before"/{NW} { BEGIN NIW; printf("B4");}
- X"for"/{NW} |
- X"fore"/{NW} { BEGIN NIW; printf("4");}
- X"four"/{NW} { BEGIN NIW; printf("FORE ");}
- X"sea"/{NW} |
- X"see"/{NW} { BEGIN NIW; printf("C ");}
- X"to"/{NW} |
- X"too"/{NW} { BEGIN NIW; printf("2"); }
- X"two"/{NW} { BEGIN NIW; printf("TO "); }
- X"one"/{NW} { BEGIN NIW; printf("1"); }
- X<INW>"ould"/{NW} {BEGIN NIW; printf("UD ");}
- X"ic"/{NW} { BEGIN NIW; printf("IK"); }
- X"le"/{NW} { BEGIN NIW; printf("EL"); }
- X"by"/{NW} { BEGIN NIW; printf("BUY"); }
- X"buy"/{NW} { BEGIN NIW; printf("BY"); }
- X"bye"/{NW} { BEGIN NIW; printf("BY"); }
- X"e"/{NW} { BEGIN NIW;
- X printf((rand()%2) ? "E" : (rand()%2 ? "E" : "3");}
- X"ewe" |
- X"you" { BEGIN INW; printf("U"); }
- X"your" { BEGIN INW; printf("YOU'RE"); }
- X"there" { BEGIN INW; printf("THARE"); }
- X"they're" { BEGIN INW; printf("THARE"); }
- X"cause" { BEGIN INW; printf("CUZ"); }
- X<INW>"or" { BEGIN INW; printf((rand()%2) ? "OR" : "ER"); }
- X"and" { BEGIN INW; printf("&"); }
- X"biff" { BEGIN INW; printf("B1FFSTER!!!!!"); }
- X"BIFF" { BEGIN INW; printf("B1FFSTERE!!!1!"); }
- X"Biff" { BEGIN INW; printf("B1FFSTERE!!!1!"); }
- X"tion" { BEGIN INW; printf("SHUN"); }
- X"good" |
- X"cool" { BEGIN INW; printf("C00L!!!"); }
- X"computer" { BEGIN INW; printf("C-64"); }
- X"software" { BEGIN INW; printf("WAREZ!1!!"); }
- X"program" { BEGIN INW; printf("WAREZ!1!!"); }
- X"gal" |
- X"girl" |
- X"woman" { BEGIN INW; printf("BAB3"); }
- X"boy" |
- X"dude" |
- X"Mr" |
- X"man"/{NW} |
- X"Man" { BEGIN INW; printf("D00D"); }
- X"some" { BEGIN INW; printf("SUM"); }
- X
- X"a" { BEGIN INW; printf("A"); }
- X"b" { BEGIN INW; printf("B"); }
- X"c" { BEGIN INW; printf("C"); }
- X"d" { BEGIN INW; printf("D"); }
- X"e" { BEGIN INW; printf("E"); }
- X"f" { BEGIN INW; printf("F"); }
- X"g" { BEGIN INW; printf("G"); }
- X"h" { BEGIN INW; printf("H"); }
- X"i" { BEGIN INW; printf((rand()%2) ? "I" : "1"); }
- X"I" { BEGIN INW; printf((rand()%2) ? "I" : "1"); }
- X"j" { BEGIN INW; printf("J"); }
- X"k" { BEGIN INW; printf("K"); }
- X"l" { BEGIN INW; printf("L"); }
- X"ll" { BEGIN INW;
- X printf((rand()%2) ? "LL" : (rand()%2 ? "L" : "LLL");}
- X"m" { BEGIN INW; printf("M"); }
- X"n" { BEGIN INW; printf("N"); }
- X"nn" { BEGIN INW;
- X printf((rand()%2) ? "NN" : (rand()%2 ? "N" : "NNN");}
- X"o" { BEGIN INW; printf("0"); }
- X"oo" { BEGIN INW;
- X printf((rand()%2) ? "00" : "UU"); }
- X"O" { BEGIN INW; printf("0"); }
- X"OO" { BEGIN INW;
- X printf((rand()%2) ? "00" : "UU"); }
- X"ph" { BEGIN INW; printf("F"); }
- X"Ph" { BEGIN INW; printf("F"); }
- X"p" { BEGIN INW; printf("P"); }
- X"q" { BEGIN INW; printf("Q"); }
- X"r" { BEGIN INW; printf("R"); }
- X"s" { BEGIN INW; printf((rand()%2) ? "5" : "S"); }
- X"S" { BEGIN INW; printf((rand()%2) ? "5" : "S"); }
- X"t" { BEGIN INW; printf("T"); }
- X"u" { BEGIN INW; printf("U"); }
- X"v" { BEGIN INW; printf("V"); }
- X"w" { BEGIN INW; printf("W"); }
- X"x" { BEGIN INW; printf("X"); }
- X"y" { BEGIN INW; printf("Y"); }
- X"z" { BEGIN INW; printf((rand()%2) ? "2" : "Z"); }
- X. printf(yytext);
- X\n printf("\n");
- X. { BEGIN INW; ECHO; }
- X
- X%%
- X
- Xmain()
- X{
- X srand(getpid());
- X yylex();
- X return(0);
- X}
- END_OF_FILE
- if test 8168 -ne `wc -c <'b1ff.l'`; then
- echo shar: \"'b1ff.l'\" unpacked with wrong size!
- fi
- # end of 'b1ff.l'
- fi
- echo shar: End of archive 1 \(of 1\).
- cp /dev/null ark1isdone
- MISSING=""
- for I in 1 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have the archive.
- rm -f ark[1-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-