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 >
Text File  |  1990-07-21  |  3KB  |  73 lines

  1.                         ****************
  2.                          Do What I Mean
  3.                         ****************
  4.  
  5.                          Colin McCormack
  6.                       Tangled Web Software
  7.                     (02) 808-1951 Australia.
  8.                        ACS: colinm@runx.oz
  9.  
  10.  
  11. Preliminary release: 0.1 (a measure of functionality) 22/03/87
  12.  
  13. 0: Why such a silly name?
  14. DWIM is a command under MACLISP or INTERLISP, it was implemented for
  15. the TENEX system initially (whatever that is/was) and it is documented
  16. in CACM as a hello-world type ADA program. It therefore has a long and
  17. illustrious history. Like the Dvorak keyboard, DWIM springs from
  18. observation of typist behaviour, hopefully DWIM will receive more user
  19. acceptance than the Dvorak keyboard.
  20.  
  21. Perhaps it's just my keyboard but I often find ZCPR running off
  22. looking for commands that don't exist and I don't like retyping
  23. commands after a (long) wait... so I wrote this in Z80 assembler
  24. for inclusion with ZCPR as a resident command.
  25.  
  26. 1: What's it supposed to do?
  27. Simply: correct around 85% of typographic errors.
  28.  
  29. Typos have been observed to fall into 5 basic categories:
  30.  
  31.     1) omission of 1 character
  32.         eg: "th ct sa o he at"
  33.  
  34.     2) inclusion of 1 spurious character
  35.         eg: "thew caty sdat onj ther mast"
  36.  
  37.     3) transposition of 2 adjacent characters
  38.         eg: "hte cta ast no teh mta"
  39.  
  40.     4) one character mistyped
  41.         eg: "thw cag say in rhe mqt"
  42.  
  43.     5) *everything* else
  44.         eg: <fill in your favourite garbage>
  45.  
  46. instead of the more familiar "the cat sat on the mat"
  47.  
  48. Fortunately, the first 4 categories account for around 85% of typos
  49. observed. Armed with a dictionary and patience a cryptanalyst could
  50. just about correct every sentence above. In DWIM, the dictionary is
  51. the CP/M file directory of the currently logged drive.
  52.  
  53. 2: presentation.
  54. I have essentially coded a public domain algorithm for inclusion
  55. in some more complex setting. I don't think DWIM *can* lead a
  56. useful existance as a stand alone application, since the data it
  57. works with is absent by the time a stand alone DWIM is executed.
  58. DWIM could be incorporated into ZCPR as a command run option, or
  59. you could include it as part of any application where you have
  60. to cope with user-originated multi character input and you have
  61. a dictionary of valid input somewhere DWIM can get at it. Oh yes,
  62. It also helps if you have a wildcard search like CP/M provides.
  63. So to have a look at the algorithm, type DWIM <filename> and
  64. wait till it presents a list of corrected/matched filenames.
  65.  
  66. 3: Implementation Details - see source code.
  67. DWIM.MAC should be fairly easy to customise/integrate into your
  68. CCP or other application.
  69.  
  70. 4: Thanx - John Hastwell Batten for the impetus and for Tesseract RCPM
  71.  
  72. - Colin McCormack.
  73.