.T SPELLING VERIFICATION PROGRAM .UC .NHY .PS 60,80 .LM 0 .C SPELL .SP 1 .HL 1 Introduction .P 8 This program has been designed to facilitate identifying typing errors and spelling mistakes in text or program source files on the PDP#11 computers. By using switches the program will search for text in Runoff, Fortran and Macro assembler files according to the rules of the relevant formats. The program produces an output file containing a dictionary of all words used in the text and/or a listing of all words that appear in the file but do not appear in a dictionary file. .S 2 .HL 1 DETAILS OF OPERATION .P There are two types of input file to SPELL. Firstly the 'dictionary' type and secondly the 'checking' type. Up to five dictionary files may be specified to SPELL excluding the file SY:SPELL.WRD which is automatically used by SPELL. These files should contain text but in any form. To optimize the speed of running it is advantageous to have each word occurring once only in a dictionary file but this is not a requirement as each word will only be loaded on its first occurrence. Also to improve speed the number of separators between words should be kept to a minimum and the dictionary should be alphabetically ordered on the first two letters in each word. The ordering of words in the dictionary has a great effect on the speed of SPELL for the first dictionary loaded (normally SY:SPELL.WRD) but for subsequent dictionaries the order does not matter nearly so much. SPELL's output dictionary file is optimally ordered for use as a dictionary file. .P To be effective as possible as many words as possible should be in the dictionaries, but this has to be balanced against the amount of memory available in the computer. In the event of shortage of space device drivers should be unloaded and turning a GT40 graphics system off (GT OFF) can also make significantly more memory available. When SPELL is started it checks the length of SY:SPELL.WRD against the amount of memory available to it and will if necessary prevent long words being loaded from it in order to prevent subsequent running out of memory. If this situation occurs a message is issued by SPELL to the user. No account is taken of the length of other dictionary files .P Most words in the checking file are examined. Where words contain digits or non printing characters they are ignored. If the last word on a line ends with a hyphen SPELL will concatenate any letters occurring on the start of the next line with that word as an attempt to dehyphenate words. SPELL also tries to deal with apostrophed words. If the word has an apostrophe in anything but the second letter and the combination 's does not occur, the word will be treated as a legal word with an apostrophed and checked against the dictionary. SPELL also checks that punctuation marks following a word do not immediately precede another word (eg dictionary.SPELL). .P A feature that may be disabled is the matching facility. For the checking file words that are not found in the dictionary are matched against all words that start with the same two letters. If there is a word that is reasonably similar, this is printed in brackets following the not-found word. .S 2 .HL 1 USE .S 2 ######.R SPELL .BR ######SPELLING CHECK(/H FOR HELP) .BR ######*OUTFIL1.LST,OUTFIL2.WRD=INFIL1.RNO,INFIL2.RNO/switches .P To use the program the above format is required, where the specification line is formatted according to the normal rules governing file specification under RT11. .S 2 .LM 24 .I -16 INFIL2##########is an optional file and if specified should contain a dictionary of words. A dictionary of a suitable form is available under the name SPELL.WRD. This file (SPELL.WRD) is now automatically included unless the /D switch is used. Up to 6 dictionary files may be specified. For the first dictionary loaded there is considerable advantage in having it alphabetically ordered on the first two letters. .S 1 .I -16 INFIL1##########must be specified and is the file in which spelling mistakes or typing errors are to be searched for. It can be either a Runoff source file, Fortran source file or a Macro assembler source file. The type or file is indicated to the program via switches detailed below. .S 1 .I -16 OUTFIL1#########must be specified and on completion of the program contains a list of all words that occurred in INFIL1, but were not in the dictionary file. If no dictionary file is specified then this file contains a list of all words found. .S 1 .I -16 OUTFIL2#########is an optional file and if specified will contain all words in the dictionary and source file. If no dictionary file is specified then this file will have identical contents to INFIL1. .S 2 .I-24 SWITCHES .S 1 .I -16 /A##############This switch indicates that INFIL1 is a Array processor source file, ie words are only examined if they occur between a inverted commas and end of line. .S 1 .I -16 /C:n############SPELL ignores words of n and less characters (default 1). .S 1 .I -16 /D##############This switch disables the automatic inclusion of the files SY:SPELL.WRD, and DK:SPELL.WRD as dictionary files. .S 1 .I -16 /E##############Every spelling error found is printed, ie each occurrence of each mistake is printed rather than once only. With this option errors are not loaded into SPELL's internal dictionary so OUTFIL2 does not contain spelling errors. .S 1 .I -16 /F##############This switch indicates that INFIL1 is a Fortran source file the program only examines words that occur on a line starting with the letter C. .S 1 .I -16 /H##############This switch causes the program to give help in its use. .S 1 .I -16 /I##############The I switch disables the facility where SPELL tries to match any errors with the closest word it has in its dictionary. .S 1 .I -16 /M##############This switch indicates that INFIL1 is a macro assembler source file, ie words are only examined if they occur between a semicolon and end of line. .S 1 .I -16 /N:n############This switch is used to set the maximum number of words that can occur on a line in the output file OUTFIL2 to n. The default value is 72 (suitable for terminals). .S 1 .I -16 /P##############Normally each error is output on a separate line, but this switch causes 3 to be placed on each line. .S 1 .I -16 /R##############This switch indicates that INFIL1 is a Runoff source file ie words are ignored on lines that start with a full stop. .S 1 .I -16 /T##############This switch indicates that INFIL1 is a RTL2 source file the program only examines words that occur on a line after the character %. .S 1 .I -16 /U##############This switch causes the dictionary to be output in upper case rather than the lower case default. .S 2 .LM 4 Switches /A,/T,/R,/M,/F are mutually exclusive and none are specified the program examines all words in the source file. .S 2 .HL 1 ERROR MESSAGES .P .LS .LE;Spell - Write error###This message will occur if either of the output files is too short or if there is a hardware error when writing to sn output file. .LE;Spell - Read error###This message will occur if there is a hardware error when SPELL tries to read a dictionary file or the file being checked. .LE;Spell - Memory overflow###This message will be given if SPELL runs out of memory when loading words from a dictionary of checking a text file. In the former case SPELL terminates, in the latter case SPELL continues but forces the /E option. This has the effect of causing each occurrence of an error SPELL finds to be printed ,rather than just the first. .LE;Spell - Address error###This message should never occur, but if it does please report this to the author. .LE;Spell - SY:SPELL.WRD not found###The default dictionary has not been found .ELS .S 2 .HL 1 PERIPHERAL REQUIREMENTS .P None .S 2 .HL 1 MACHINE DEPENDENCY .P Runs on any PDP#11 computer under RT11, the larger the store the better.