home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / SP12DCT.ZIP / SPELCHEK.DOC < prev    next >
Encoding:
Text File  |  1991-03-27  |  11.6 KB  |  272 lines

  1. SPELCHEK Version 1.2 - A *FAST* spelling checker by Edwin Floyd.  3-27-91
  2.  
  3. Version 1.2 implements a new, faster dictionary algorithm which
  4. is incompatible with previous versions.  Please rebuild all user
  5. dictionaries with MAKEDICT.  SPELCHEK is distributed in three files:
  6.  
  7.    SP12EXE.ZIP - Executable programs
  8.    SP12DCT.ZIP - Dictionaries (large file)
  9.    SP12SRC.ZIP - TP6.0 source code to all programs
  10.  
  11. Purpose of SPELCHEK
  12. -------------------
  13. SPELCHEK extracts words from an input file, or several input files,
  14. and checks them for membership in a superimposed code dictionary.
  15. Any words not found in the dictionary, it writes to an output file,
  16. one per line.  The program recognizes a number of options for:
  17.  
  18.   o High-order bit stripping
  19.  
  20.   o Appending additional information to the output word list
  21.  
  22.   o Defining the characters comprising a "word"
  23.  
  24. How to run SPELCHEK
  25. -------------------
  26. From the DOS command line enter:
  27.  
  28.   SPELCHEK filenames [-H] [-M] [-W[+/-]abc..] [@name] [-Uname]
  29.            [-Oname] [-Ppath]
  30.  
  31. Spaces delimit command line parameters.  You may intermingle
  32. input text filenames and options (mark each option with a leading
  33. hyphen).  Some options (-W,-O,-U) allow a character string or
  34. filename to follow the option letter.  This must follow with no
  35. intervening spaces or the program will mistake it for an input
  36. file name.  Some options (-H,-M) allow a "+" or "-" to
  37. indicate "on" or "off".  This also must follow with no
  38. intervening space, and "+" is assumed if it is omitted.  You may
  39. place options and filenames in an ASCII "include" file and
  40. specify its name with a leading "@" on the command line.  An
  41. include file may contain references to other include files.  You
  42. also may specify default options, filenames and include files in
  43. the DOS environment using "SET SPELCHEK=...".  For example:
  44.  
  45.   SET SPELCHEK=-H+ -Owords.out -W-ABCDEFGHIJKLMNOPQRSTUVWXYZ
  46.   SET WORDS=@defaults.spc -O
  47.  
  48. SPELCHEK processes options left-to-right, first from the DOS
  49. environment, then from the command line.  Where options conflict,
  50. the last option processed prevails.  Thus, you may override "SET"
  51. environment options on the command line.
  52.  
  53. What the options mean
  54. ---------------------
  55. -H[+/-]  Clear the high-order bit on each input character
  56.          (default off).  Use this option to process files
  57.          created by word processing programs, like WordStar,
  58.          that mark some letters by setting the high-order
  59.          bit, often at the beginning or end of a word.
  60.  
  61. -M[+/-]  Append markup information to output word list.  This
  62.          causes the program to insert a number in front of each
  63.          word written to the output file.  The number indicates
  64.          the byte position in the input where the offending word
  65.          begins.  The first byte in the input file is position 1.
  66.          Also, the program writes the file name at the beginning
  67.          of the word list for each input file.  The file name is
  68.          preceded by a zero and a space.  This output file is
  69.          intended as input to a program such as MARKDOC which
  70.          marks misspelled words in the input document.
  71.  
  72. -P[path] Indicate the drive and directory containing the
  73.          master dictionary files.  There are seven master
  74.          dictionary files: AB.DCT, CD.DCT, EH.DCT, IN.DCT,
  75.          OR.DCT, ST.DCT and UZ.DCT.  They all must reside
  76.          in the same directory.  If no -P path is specified,
  77.          the master dictionary files must reside in the current
  78.          directory or the program directory.  The master dictionary
  79.          files were created with MAKEDICT (see below) from a list
  80.          of over a hundred thousand words obtained from from Public
  81.          Brand Software, 1-800-IBM-DISK.
  82.  
  83. -U[name] Name a user dictionary file.  This option specifies the
  84.          name of an existential dictionary file produced by the
  85.          MAKEDICT program.  You may specify the drive and full path.
  86.          If a simple file name is specified, the file is assumed to
  87.          be in the current directory.  If SPELCHEK can't open the
  88.          user dictionary, it issues a warning message and processes
  89.          the input files against the master dictionaries only.
  90.  
  91. -W-abc.. Replace the "word character set" with the indicated
  92.          characters.  The program checks each character in
  93.          each input file for membership in the word character
  94.          set and defines a "word" as an uninterrupted
  95.          sequence of at least one but no more than 255
  96.          characters which are members of that set.  The
  97.          default is the set of upper and lower case
  98.          alphabetic characters.
  99.  
  100. -W+abc.. Add additional characters to the word character set.
  101.  
  102. -O[name] Name the output file.  If the name is omitted ("-O "),
  103.          output goes to "StdOut" and is available for DOS a
  104.          pipe (|) or redirection (>).  StdOut is the
  105.          default.
  106.  
  107. -O-      Suppress output.  -Onul also suppresses output.  The
  108.          program will still display word counts on the
  109.          screen.
  110.  
  111. Two examples
  112. ------------
  113. 1. Generate list of all misspelled words in the document named
  114. MYSTORY.DOC and write the list to file MYSTORY.BWD. The following
  115. are equivalent:
  116.  
  117.   SPELCHEK mystory.doc -Omystory.bwd
  118.  
  119.   SPELCHEK mystory.doc >mystory.bwd  (default StdOut)
  120.  
  121.   SET SPELCHEK=-Omystory.bwd         (set defaults)
  122.   SPELCHEK mystory.doc
  123.  
  124.   If at this point we want an alphabetic, un-duplicated list of misspelled
  125.   words, we can use the WORDS program (see WORDS.DOC for other uses):
  126.  
  127.   WORDS mystory.bwd -omystory.unq -a
  128.  
  129. 2. Generate list of misspelled words in the documents named
  130. HISPHYS.WS and OPREPORT.WS and use the list as input for MARKDOC to
  131. mark misspelled words in both documents.  The files are WordStar
  132. documents and we wish to check a user dictionary called MEDTERM.DCT
  133. in the current directory.  The main dictionary files reside in
  134. directory: D:\SPELL.
  135.  
  136.   SET SPELCHEK=-Pd:\spell -H -O -M -Umedterm.dct
  137.   SPELCHEK hisphys.ws opreport.ws | MARKDOC
  138.  
  139. We could have specified all the options on the command line.
  140. Ordinarily you should set the -P and -U options in the environment.
  141.  
  142. Networks
  143. --------
  144. FYI, network users, SPELCHEK opens its input files in "Read, Deny
  145. None" mode, @include files "Read, Compatibility", and the output
  146. file in "Write, Compatibility".  Only one input file at a time is
  147. open, except during processing of nested @include files.
  148.  
  149. MAKEDICT
  150. --------
  151. MAKEDICT creates an optimal existential dictionary (Bloom filter) which
  152. can be used by SPELCHEK with the "-U" option (see above).  From the DOS
  153. command line, enter:
  154.  
  155.   MAKEDICT infile [bits] [extra]
  156.  
  157. The input file should be a list of words, one per line.  All
  158. characters should be upper case if the dictionary is intended
  159. for use with SPELCHEK.  The second parameter, "bits", specifies
  160. the number of bits to superimpose for each input word.  The
  161. number of bits partly determines the accuracy of the dictionary.
  162. For use with SPELCHEK, specify the default, 14 bits.  The third
  163. parameter, "extra", specifies an allowance of extra space so words
  164. may be added to the dictionary and it still remain within the
  165. accuracy specified by the "bits" parameter.  The default is zero.
  166. The output file is given the same name as the input file, except
  167. the extension is ".DCT".  If the input file extension is ".DCT",
  168. the output file is given the extension ".DIC".
  169.  
  170. To create a user dictionary for SPELCHEK, only the input file need
  171. be specified.  The defaults for "bits" and "extra" are exactly what
  172. is required for a user dictionary.  Example:
  173.  
  174.   MAKEDICT medterm.lst
  175.  
  176. This creates a user dictionary called: MEDTERM.DCT suitable for use
  177. by SPELCHEK.
  178.  
  179. MAKEDICT prints dictionary statistics, including the odds against
  180. incorrectly recognizing a word which is not in the dictionary.  Please
  181. remember, a Bloom filter is a probabilistic technique; collisions are
  182. possible, but you control the collision probability by the bits setting.
  183. All main dictionaries were created with 14 bits, corresponding to about
  184. a 1/16384 chance of collision.  When you specify a user dictionary, the
  185. odds increase to 1/16384 plus the user dictionary odds.  Thus, a 14-bit
  186. user dictionary would increase the odds of a collision to about 1/8192.
  187. This means, on the average, SPELCHEK will miss about one out of every
  188. 8192 different misspelled words.  For instance, if a really bad speller
  189. misspells (differently) about every tenth word in an 80,000-word
  190. document, SPELCHEK may miss one of the misspellings.
  191.  
  192. MARKDOC
  193. -------
  194. MARKDOC reads the output file produced by SPELCHEK with the -M+
  195. option and marks misspelled words in the input files.  From the
  196. DOS command line, enter:
  197.  
  198.   MARKDOC [markchars] [<infile]
  199.  
  200. MARKDOC reads its standard input file (STDIN).  Each input line
  201. begins with a number.  The number zero is always followed by a
  202. document file name.  Each non-zero number indicates the position
  203. of the first character of a misspelled word in the current
  204. document file.  MARKDOC reads each document file and writes an
  205. output file which is the same as the input file, except each
  206. misspelled word is preceded by "mark" characters.  The
  207. default mark character is a single "#", but you may specify
  208. mark characters as a parameter on the command line.  Examples:
  209.  
  210.   SPELCHEK document.fil -M+ | MARKDOC %@
  211.  
  212.   SPELCHEK -M+ document.fil -Omark.$$$
  213.   MARKDOC <mark.$$$
  214.  
  215. MARKDOC saves a copy of the document file under the same name
  216. as the original document except with the extension ".BAK".
  217.  
  218. Note: MARKDOC expects to read a file produced by SPELCHEK with the
  219. -M+ option.  If this option is not set, MARKDOC will abort with a
  220. Pascal error 106.  MARKDOC is intended as a demonstration of one
  221. use of the -M+ output file.  Its crash resistance should be
  222. improved before it's let out into the real world.
  223.  
  224. WORDS
  225. -----
  226. WORDS is a word extractor program useful for creating word lists for
  227. MAKEDICT, among other things.  See WORDS.DOC for documentation.
  228.  
  229. Legal Stuff
  230. -----------
  231. SPELCHEK.EXE, MAKEDICT.EXE, MARKDOC.EXE, WORDS.EXE, SPELCHEK.DOC,
  232. and WORDS.DOC and all source code files, dictionaries, and word
  233. lists are:
  234.  
  235. Copyright (c) 1990,91 by Edwin T. Floyd,
  236. All rights reserved.
  237.  
  238. SPELCHEK is copyrighted "free" software.  The author hereby
  239. expressly permits and encourages individuals to use SPELCHEK at
  240. home and at work and to distribute it without charge.  The author
  241. prohibits distribution of SPELCHEK for profit, or as a part of a
  242. product sold for profit, except where explicit written permission
  243. has been obtained from the author for such distribution.  Also,
  244. users groups and shareware libraries charging a disk duplication
  245. fee not exceeding $10.00 may distribute SPELCHEK.
  246.  
  247. The author makes no warranties of any kind, either expressed or
  248. implied, as to mercantability or fitness for any particular
  249. purpose.  SPELCHEK, et. al., are available as is and in no event
  250. will the author be held liable for damages, including any lost
  251. profits or incidental or consequential damages, even if the author
  252. has been advised of the possibility of such damages.
  253.  
  254. Authorship
  255. ----------
  256. SPELCHEK was written in Turbo Pascal v6.0 by:
  257.  
  258.   Edwin T. Floyd         [76067,747]  (CompuServe)
  259.   #9 Adams Park Court    404/576-3305 (work)
  260.   Columbus, GA 31909     404/322-0076 (home)
  261.  
  262. The latest version of SPELCHEK is available on CompuServe in
  263. the IBMAPP forum, and on a number of bulletin boards around the
  264. country.
  265. - Edwin -                                                 3-27-91
  266.  
  267. Revision History
  268. ----------------
  269. 05-13-90 V1.0 ETF Original release & DDJ submission.
  270. 01-10-91 V1.1 ETF Test version, Bloom filter CRC algorithm (not released)
  271. 03-27-91 V1.2 ETF Update for TP6.0 and second public release
  272.