readme

advertisement
ABOUT XLATE - updated 9/24/96 by Lou Duchez
For years -- since 01/01/80, if you believe the timestamp -- the
program JIVE.COM, written by some unknown programmer, has been
delighting the PC world with its ability to turn "normal" English
into "Jive" ... actually into an urbanized form of coonass, if
the sage Orton Nenslo is to be trusted on this point.
A fine piece of work though JIVE.COM is, it falls short on a
number of points, including:
- lockups if the input file does not exist
- incorrectly handling words at the start or end of the line
- inflexibility
So I was inspired to write an updated version of JIVE.COM, but to
correct the known flaws and to allow for user-defined translation
tables ("lexicons"). I further wanted to write the program in
ANSI C, so that it could be compiled and run on the widest
variety of platforms available with minimal effort (the original
seems to have been written in 8086 ASM).
The ZIP file you received *should* contain the following:
XLATE.EXE
XLATE.C
BRONNER.LEX
JIVE.LEX
COCKRNEE.LEX
-
BOMBER.LEX
Duchez)
NEOTECH.LEX
SHAKEY.LEX
STERNO.LEX
-
VIZ.LEX
UK.LEX
XYZ.LEX
-
ZOOGZ.LEX
-
CLAM.LEX
BORK.LEX
CAPS1.LEX
-
CAPS2.LEX
-
JIVE.COM
README.DOC
-
-
The XLATE program, compiled for DOS
The source code to XLATE
Dr. Bronner lexicon (by Lou Duchez)
Jive lexicon (by Lou Duchez, after JIVE.COM)
Cockney lexicon (by Chris Salt, Anglo-Mutant
Supreme)
Mad Midnight Bomber What Bombs At Midnight (by Lou
Neo-Tech (by Lou Duchez)
Billy-Bob Shakespeare (by Chris Salt)
Pope Sterno Keckhaver (by Chris Salt and
Technogoddess Jools Sorrell, after program by
Michael Townsend to emulate Pope Sterno of
the Church of the SubGenius)
"Viz" magazine (by Chris Salt)
General Britishness (by Chris Salt)
RC Richards (by Reverend Pee Kitty of the
Church of the SubGenius)
Zoogz Rift, the Liquid Moamo (by St. Ain-Soph
of the Church of the SubGenius)
Scientologists (by Martin Hunt)
Swedish Chef (by Martin Hunt)
Convert all-caps text to numeric keys (to be used in
conjunction CAPS2.LEX) (by Martin Hunt)
Convert numeric-keyed text (from CAPS1.LEX) to
properly-cased text -- HELPS MAKE THIS SORT OF ALLCAPS TEXT READABLE (by Martin Hunt)
the original source of all this "inspiration"
This document
To run XLATE:
1)
2)
3)
Create an ASCII text file with the text you want to mangle.
For this example, let's call the file "stoner".
Decide which lexicon you want to mangle the text with. For
this example, let's use "zoogz.lex".
Run the command:
xlate zoogz.lex stoner
The text will scroll down the screen. Standard piping and
routing may be used to manage the output.
4)
5)
A third parameter may be specified: an output file name.
A fourth parameter may be specified: a line width so that
XLATE will wrap your text. To wrap text at column 72,
include the parameter: "-w72".
CREATING YOUR OWN LEXICON FILES
Lexicon files are standard ASCII text files, and their format is
as simple as I know how to make it. A given lexicon entry will
look something like:
" man ", "dude"
The line tells XLATE exactly what you think it would: every
instance of the word "man" should be converted into "dude".
If you want to make use of expressions that contain quotes,
represent each quote with a *pair* of quotes. For example, to
turn the word messiah into "Bob" with quotes, the line would look
like:
"messiah", """Bob"""
Note that there are a few subtle variations you need to take into
account with the "normal" expression:
"man", "dude"
"man ", "dude"
" man", "dude"
" man ", "dude"
The spaces on either side of "man" serve as a cue as to whether
the expression needs to be at the start or end of a word. In the
first instance, "man" will be converted into "dude" whether or
not it begins or ends a word. For example, the following xlations
will occur:
brinkmanship -> brinkdudeship
Batman -> Batdude
maneuver -> dudeeuver
man -> dude
The second instance means that "man" must end a word to be
xlated. For example, the following xlations will occur:
Batman -> Batdude
man -> dude
The third instance means that "man" must begin a word to be
xlated. For example, the following xlations will occur:
maneuver -> dudeeuver
man -> dude
The fourth instance means that "man" must both begin and end a
word, i.e., "man" cannot be a part of any other word, but a word
unto itself. The only xlation that occurs is:
man -> dude
NOTE: spaces at the beginning or ending of the "xlation" will be
taken LITERALLY. Consider the following lexicon line:
" man ", " dude "
If XLATE encounters the following sentence:
They fought man-to-man.
The output will be:
They fought
dude -to- dude .
So don't try to put any special formatting codes in the
"xlations".
Hope you enjoy the program. For you C programmers out there:
yes, I know I could optimize this baby left and right ... the
most obvious issue being the use of dynamic memory. But I
intended the source code to be as clear as possible, so that even
beginning C programmers could follow it; I leave it to *you* to
optimize the program if it really means that much to you. (Just
leave my name in there somewhere, okay? I'm that petty.)
And if you want to get in contact with me, with questions,
suggestions, or just for general schmoozing, I am:
Lou Duchez - ljduchez@en.com
My Web page (get updates here): http://www.en.com/users/ljduchez
Consider this program freeware; put it on FTP sites, distribute it to
friends, whatever. Please don't alter the original XLATE program and
distribute it as the "real thing"; you're welcome to take whatever
inspiration you like from my code and create a better product, but
don't be passing it off as XLATE. (Again, please leave my name in a
comment somewhere lest I be completely forgotten.)
And of course, if you've come up with a good lexicon, feel free to
send it to me and I'll get in the habit of distributing it. Remember,
it's the lexicons that make XLATE fun; the program is what it is, but
it's the users who make the program interesting. Martin Hunt's
CAPS1.LEX and CAPS2.LEX are a perfect example of this: I wouldn't
have thought in a million years to do anything USEFUL with XLATE.
---Revision history (largely documented in XLATE.C)
04-29-95: Initial release
05-01-95: Bug fix: eliminated error where program would miss text to
translate if the same text was found earlier on the line, but
in the middle of a word (this was a problem only if the text
needed to start or end a word)
Code is documented
Upper-casing code is revised to be ANSI-compliant
Quotes may be indicated inside English or foreign texts by
using two quotes in immediate succession
05-02-95: WRDSIZ is increased from 30 to 60 to accommodate longer texts
When called without parameters, XLATE lists the revision date
05-06-95: Word wrap option added
Third file (destination file) may be named on command line
File names specified on errors
05-07-95: Stopped capitalizing command-line options to make things work
properly under Unix
11-14-95: Clean up extraneous code that the Bearded Guy's compiler
spotted
04-21-96: If identical English entries are found in the lexicon, select
one at semi-random
07-04-96: Added BORK.LEX
09-24-96: Input file is now optional -- takes input from STDIN if no
file is specified. Useful for piping operations, like to
chain CAPS1.LEX and CAPS2.LEX together ... DOS example:
type uglytext | xlate caps1.lex | xlate caps2.lex
Added CAPS1.LEX and CAPS2.LEX
Removed OS/2 executable from ZIP -- I don't have OS/2 and
can't keep that executable current
Download