home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
BEEHIVE
/
UTILITYS
/
DWIM.ARC
/
DWIM.DOC
< prev
next >
Wrap
Text File
|
1990-07-21
|
3KB
|
73 lines
****************
Do What I Mean
****************
Colin McCormack
Tangled Web Software
(02) 808-1951 Australia.
ACS: colinm@runx.oz
Preliminary release: 0.1 (a measure of functionality) 22/03/87
0: Why such a silly name?
DWIM is a command under MACLISP or INTERLISP, it was implemented for
the TENEX system initially (whatever that is/was) and it is documented
in CACM as a hello-world type ADA program. It therefore has a long and
illustrious history. Like the Dvorak keyboard, DWIM springs from
observation of typist behaviour, hopefully DWIM will receive more user
acceptance than the Dvorak keyboard.
Perhaps it's just my keyboard but I often find ZCPR running off
looking for commands that don't exist and I don't like retyping
commands after a (long) wait... so I wrote this in Z80 assembler
for inclusion with ZCPR as a resident command.
1: What's it supposed to do?
Simply: correct around 85% of typographic errors.
Typos have been observed to fall into 5 basic categories:
1) omission of 1 character
eg: "th ct sa o he at"
2) inclusion of 1 spurious character
eg: "thew caty sdat onj ther mast"
3) transposition of 2 adjacent characters
eg: "hte cta ast no teh mta"
4) one character mistyped
eg: "thw cag say in rhe mqt"
5) *everything* else
eg: <fill in your favourite garbage>
instead of the more familiar "the cat sat on the mat"
Fortunately, the first 4 categories account for around 85% of typos
observed. Armed with a dictionary and patience a cryptanalyst could
just about correct every sentence above. In DWIM, the dictionary is
the CP/M file directory of the currently logged drive.
2: presentation.
I have essentially coded a public domain algorithm for inclusion
in some more complex setting. I don't think DWIM *can* lead a
useful existance as a stand alone application, since the data it
works with is absent by the time a stand alone DWIM is executed.
DWIM could be incorporated into ZCPR as a command run option, or
you could include it as part of any application where you have
to cope with user-originated multi character input and you have
a dictionary of valid input somewhere DWIM can get at it. Oh yes,
It also helps if you have a wildcard search like CP/M provides.
So to have a look at the algorithm, type DWIM <filename> and
wait till it presents a list of corrected/matched filenames.
3: Implementation Details - see source code.
DWIM.MAC should be fairly easy to customise/integrate into your
CCP or other application.
4: Thanx - John Hastwell Batten for the impetus and for Tesseract RCPM
- Colin McCormack.