.PAGE SIZE 58,80 .LEFT MARGIN 8 .RIGHT MARGIN 72 .SET PARAGRAPH 0,, .ENABLE TOC .AUTOPARAGRAPH .LAYOUT 1,4 .TITLE My Extended EVE Editor .STYLE HEADER 4 .HEADERS ON .FIGURE 12 .c80;MY EXTENDED EVE EDITOR .SKIP 4 .c80;(INCLUDING) .SKIP 2 .c80;(A SIMPLE SPELLING CHECKER FOR EVE) .SKIP 12 .c80;written by: .SKIP 2 .C80;Thomas Wolfe .C80;Jet Propulsion Laboratory .C80;Mail Stop 510/202 .C80;4800 Oak Grove Drive .C80;Pasadena, CA 91109 .C80;(818) 397-9280 .PAGE .REQUIRE "XEVE.RNT" .PAGE .HEADER LEVEL INTRODUCTION A extended EVE editor that includes a spelling checker is provided. A separate standalone spelling checker patterned after the LBL software tools SPELL utility is also provided. Both spelling checkers user three dictionaries to test the spelling of words. A common dictionary (standard english words), a project dictionary (acronyms, etc.) and a user defined dictionary. The user defined dictionary can be created/updated while in an EVE edit session. Utilities are provided to build all three dictionaries from text files containing one word per line. The source word file for the common dictionary must be in ascending (lexical) sort order. The project and user source word files do not. The common dictionary currently contains 91,000+ words. The project dictionary can contain 1,000 word (or 10,000 bytes). The user dictionary can contain 200 words (or 2,000 bytes). The maximum word size is currently 31 characters. The above limits can be modified by changing a few parameters and recompiling the programs. The EVE editor has also been expanded with special edit command and key definitions. .HEADER LEVEL SYSTEM WIDE LOGICAL NAMES The following is an example of DCL commands that define the system wide logical names for the Spelling checker(s). They point to the directories containing the common and project dictionaries and the shared image file that is part of the extended EVE editor. The extended EVE help library is also pointed to. .LITERAL $ DEFINE/SYSTEM COMMON_DICTIONARY SYSTEMDISK:[XEVE] $! $ DEFINE/SYSTEM TPU$CALLUSER - SYSTEMDISK:[XEVE]TPU_CALLUSER.EXE $! $ DEFINE/SYSTEM EXTENDED_EVE_HELP - SYSTEMDISK:[XEVE]EXTENDED_EVE_HELP $! $ DEFINE/GROUP PROJECT_DICTIONARY PROJECTDISK:[PROJECT] .END LITERAL .HEADER LEVEL USER LOGIN.COM LOGICAL NAMES AND SYMBOLS The following should be added to the user LOGIN.COM file. The directory where the user dictionary will reside is defined as well as symbols for the extended EVE and the standalone spelling checker. .LITERAL $ DEFINE USER_DICTIONARY USERDISK:[USERDIR] $! $ E :== EDIT/TPU/SECTION=SYSTEMDISK:[XEVE]EDITOR $! $ SPELL :== $SYSTEMDISK:[XEVE]SPELL.EXE .END LITERAL .HEADER LEVEL USING THE STANDALONE SPELLING CHECKER To use the standalone spelling checker enter the command SPELL followed by the name of the file to be checked. If no file is entered the program prompts for one. Each line in the file will be displayed on the terminal. Each word that is not found in any of the dictionaries will be indicated by a row of asterisks under it. .HEADER LEVEL USING EXTENDED EVE Several new EVE command have been defined. They are entered by pressing the "DO" key. After the "Command:" prompt enter one of the new commands. Several control keys and/or key combinations have also been defined. These commands are executed by pressing the correct key or combinations of keys. .HEADER LEVEL THE SPELL COMMAND The SPELL command will check the spelling of words in a specified range or type of file. If a range is specified the file is assumed to be a text file and all word are spell checked. If a particular type of file is specified only some lines/word will be checked for spelling. For example, the spelling checker know a little about FORTRAN syntax and will only spell check comments and character constants. Note: only the first character (upper or lower case) of the BUFFER, PARAGRAPH, FORTRAN, etc. parameter needs to be entered. The SPELL command notifies the user that it is loading the dictionaries. A warning message is displayed if the project and/or the user dictionary is not found. Execution is terminated if the common dictionary can not be found. Each word is displayed in reverse video as it is checked. If the word can not be found in any of the dictionaries the prompt "Enter Replacement Word :" is displayed. At this point the user has several options. They may enter a carriage return which accepts the current spelling of the word. They may enter one or more characters (followed by a carriage return) to be substituted for the word. They may also may enter a CRTL Z which stops the spell checking activity and return back to the normal edit mode. .SET LEVEL 2 .HEADER LEVEL SPELL OR SPELL BUFFER To spell check the entire buffer enter SPELL, SPELL BUFFER or SPELL B. Every word in the buffer will be spell checked. Words do not span across the end of line boundry. .HEADER LEVEL SPELL PARAGRAPH To spell check the current paragraph enter SPELL PARAGRAPH or SPELL P. Paragraphs are delimited by blank lines, beginning or end of buffer. Every word in the paragraph will be spell checked. Words do not span across the end of line boundry. .HEADER LEVEL SPELL HERE To spell check from the current line to the end of the buffer enter SPELL HERE or SPELL H. Words do not span across the end of line boundry. .HEADER LEVEL SPELL C To spell check a C source code file enter SPELL C. Only comments are spell checked. A comment is everything starting with "/*" and ending with "*/". .HEADER LEVEL SPELL DCL To spell check a DCL command file enter SPELL DCL or SPELL D. Only comments are are spell checked. A comments is everything after a "!" on a line. .HEADER LEVEL SPELL FORTRAN To spell check a FORTRAN source code file enter SPELL FORTRAN or SPELL F. Only comments and character constants will be checked. A comment is any line with a 'C' in column one or everything after a '!' on a line. A string constant is anything delimited by single quote marks on a line. Two passes through the file are made. The first checks comments and the second checks character constants. .HEADER LEVEL SPELL MACRO To spell check a MACRO source code file enter SPELL MACRO or SPELL M. Only comments are spell checked. A comment is is everything after a ";" on a single line. .HEADER LEVEL SPELL RNO To spell check a RUNOFF source file enter SPELL RUNOFF or SPELL R. Spell check every line except those with a period in column one. .SET LEVEL 2 .HEADER LEVEL THE LOAD COMMAND The LOAD command creates a new buffer and fills it with the words in the user dictionary. If no user dictionary is found the buffer is filled with a default set of words. After filling the new buffer, the buffer may be edited (changed) to reflect the users current needs. .HEADER LEVEL THE UPDATE COMMAND The UPDATE command initialize the user dictionary and fills it with the words found in the current buffer. If no user dictionary exists one is created. If one already exists it is over-written. The words are inserted into the user dictionary in lexical sort order. If the current buffer was created by the LOAD command the user returns back to the previous buffer. If an error occurs during the update step the user dictionary may be left in an undefined state. Stop and correct the problem. .HEADER LEVEL HINTS AND KINKS The replacement word is not checked for spelling. You can replace a misspelled word with another misspelled word. .HEADER LEVEL DEFINITION OF A WORD In the spelling checker(s) a word is defined as one or more contiguous alphabetic characters (case insensitive). Internally words are stored in 32 byte arrays. The first byte of the array is the length of the word followed by the word. .HEADER LEVEL DICTIONARY SEARCH The dictionary files are search in the following order: user dictionary, project dictionary, common dictionary index and then the common dictionary. The first three dictionaries are in memory and a binary search used. The common dictionary is searched sequentially starting with the record number supplied by searching the common dictionary index. The common dictionary index contains every 20th word in the common dictionary file. .SET LEVEL 1 .HEADER LEVEL OTHER EDITOR COMMANDS .SET LEVEL 2 .HEADER LEVEL THE CRTL D KEY Delete the current line. .HEADER LEVEL THE CRTL L KEY Display information about the location of the current line in relation to the complete file. .HEADER LEVEL THE CRTL P KEY Display the current position of the cursor on the line. .HEADER LEVEL THE PF1 KEY This is the alternalte shift key. It is used in conjunction with other keys to form two key commands. .HEADER LEVEL THE PF2 KEY If two window are being displayed, move to the other window. .HEADER LEVEL THE F9 KEY Move to the next word. .HEADER LEVEL THE F10 KEY Move the cursor from one window to the other wneh displaying two windows. .HEADER LEVEL THE F11 KEY Move to the beginning of the current line. .HEADER LEVEL THE F12 KEY Move to the end of the current line. .HEADER LEVEL THE ALTERNATE SHIFT 1 COMMAND Convert the screen to one window from two windows. To execute this command press the alternate shift key and then the X key. .HEADER LEVEL THE ALTERNATE SHIFT 2 COMMAND Split the screen into two sections which are windows into the same file. To execute this command press the alternate shift key and then the X key. .HEADER LEVEL THE ALTERNATE SHIFT U COMMAND Convert the current word to uppercase. To execute this command press the alternate shift key and then the X key. .HEADER LEVEL THE ALTERNATE SHIFT L COMMAND Convert the current word to lowercase. To execute this command press the alternate shift key and then the X key. .HEADER LEVEL THE ALTERNATE SHIFT T COMMAND Transpose the two characters to the left of the cursor. This is a cute but not very useful command I get from a magazine article. To execute this command press the alternate shift key and then the X key. .HEADER LEVEL THE ALTERNATE SHIFT W COMMAND Toggle the display between 80 and 132 character wide. .HEADER LEVEL THE ALTERNATE SHIFT X COMMAND Display a menu that allow the user to do the following to the current buffer. .LIST .LIST ELEMENT Remove all TABs and spaces from the end of every line. .LIST ELEMENT Convert all TABs to eight spaces. .LIST ELEMENT Convert all control characters (0 thru 31) to descriptive text strings. .LIST ELEMENT Convert descriptive text strings to control charactrs (0 thru 31). .END LIST .HEADER LEVEL THE BULLET COMMAND The BULLET command formats a paragraph into bullet type form. The first non-blank word is the bullet item. All other text makes up the bullet text. .LITERAL A formatted bullet has the following form: item text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text ^ ^^ ^ | || | | |+--------- TEXT LEFT AND RIGHT MARGINS ---------+ | | ->| |<---- ITEM SPACE | +----------- ITEM LEFT MARGIN The BULLET command has the following forms: Commands Description BULLET Format a bullet using the defined margins BULLET X Display the bullet margins that are currently set (X is any non numeric string). BULLET 10 Redefine the bullet item space to 10 (the text left margin is adjusted so that the item space = 10) and then format a bullet. BULLET 2 4 60 Redefine the item left margin to 2, the text margins to 4 thru 60 and then format a bullet. .END LITERAL .HEADER LEVEL THE HELP COMMAND The standard EVE help has been replaced by my version. It contains information about the extended EVE commands and other information such as standard EVE commands. .HEADER LEVEL THE MENU COMMAND See alternate shift X comamnd. .HEADER LEVEL THE TRIM COMMAND Remove all TABs and spaces from the end of every line in the curent buffer. .SET LEVEL 1 .HEADER LEVEL USER MODIFICATION OF EXTENDED EVE It is expected that most users will want to add their own extensions to the editor. There are several ways of doing this. One is to modify the EDITOR.TPU. This would make it difficult to receive updates and corrections to the current editor. The best way is to use the /COMMAND qualifier when executing the editor. This slows down image activation if there are many additions. On the plus side the user gets the latest and greatest version of the editor every time. A third way is to extend the editor and keep a local *.TPU$SECTION file. If a user does this and uses the procedure TPU$LOCAL__INIT, the following should be included to insure that extended EVE works correctly. .LITERAL ! definitions for the spelling checker eve$arg1_spell := 'string'; dictionary$available := 0; dictionary$buffer := 0; default$buffer := 0; ! definitions for the bullet formatter eve$arg1_bullet := 'string'; eve$arg2_bullet := 'string'; eve$arg3_bullet := 'string'; bullet_item_left := 0; bullet_text_left := 0; bullet_text_right := 0; item_characters := 'abcdefghijklmnopqrstuvwxyz' + 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + '[]{}<>()0123456789;:."''' + '!@#$%^&*~|/\?-_+='; item_pattern := span(item_characters); ! eve commands connected to key(s) define_key ('eve_other_window',PF2); define_key ('eve_start_of_line',F11); define_key ('eve_end_of_line',F12); define_key ('eve_move_by_word',F7); define_key ('eve_one_window', key_name('1',shift_key)); define_key ('eve_two_windows', key_name('2',shift_key)); define_key ('eve_uppercase_word', key_name('u',shift_key)); define_key ('eve_lowercase_word', key_name('l',shift_key)); ! my commands connected to key(s) define_key ('my_editor_what_line',CTRL_L_KEY); define_key ('my_editor_delete_line',CTRL_D_KEY); define_key ('my_editor_show_position',CTRL_P_KEY); define_key ('eve_menu', key_name('x',shift_key)); define_key ('my_editor_transpose', key_name('t',shift_key)); define_key ('my_editor_toggle_width', key_name('w',shift_key)); ! define an alternate shif key set (shift_key,pf1); .END LITERAL .HEADER LEVEL POSSIBLE FUTURE IMPROVEMENTS Expand the special SPELL commands (C, FORTRAN, etc.) abilities. Tune the common dictionary access algorithm to minimize the word access time. Convert the common dictionary from a VAX/VMS relative file to an ISAM file with the key being the word. This would eliminate searching the common dictionary index file. Rewrite the dictionary search code (currently FORTRAN) in a more appropriate language such C or MACRO. Make the common index, project and user dictionaries mapped global sections. Allow the user to add words to a special dictionary that only exists for an given edit session. Room has been left in the common dictionary index data structures for this purpose. .HEADER LEVEL EXTENDED EVE FILES AND DESCRIPTIONS The following is a description of the files that make up the spelling checker(s). The source code files are not described. .SET LEVEL 2 .HEADER LEVEL AAAREADME.MEM A brief description of the spelling checker(s). generated by RUNOFF. .HEADER LEVEL BUILD__ALL.COM A DCL command file that compiles and links all of the spelling checker programs. It also rebuilds all libraries. .HEADER LEVEL BUILD__COMMON__DICT.EXE This program builds the common dictionary and index files from the text file COMMON__WORDS.DAT. COMMON__WORDS.DAT is a file that contains common dictionary source words (one per line). The first set of contiguous non-blank characters is used as the word. COMMON__WORDS.DAT must be in ascending (lexical) sort order. .HEADER LEVEL BUILD__PROJECT__DICT.EXE This program builds the project dictionary file from the text file PROJECT__WORDS.DAT. PROJECT__WORDS.DAT is a file that contains dictionary source words (one per line). The first set of contiguous non-blank characters is used as the word. .HEADER LEVEL BUILD__USER__DICT.EXE This program builds the user dictionary file from the text file USER__WORDS.DAT. USER__WORDS.DAT is a file that contains dictionary source words (one per line). The first set of contiguous non-blank characters is used as the word. .HEADER LEVEL COMMON.DICT Common dictionary file created by BUILD__COMMON__DICT.EXE. This file is a VAX/VMS relative file with fixed length records of 32 bytes. .HEADER LEVEL COMMON.INDEX Common dictionary index file created by BUILD__COMMON__DICT.EXE. .HEADER LEVEL COMMON__DICT.RPT Report file generatd by COMMON__DICT__REPORT. To save disk space This file is not distributed but may be built by the program COMMON__DICT__REPORT.EXE. .HEADER LEVEL COMMON__DICT__REPORT.EXE Generate a report containing all of the words in the common dictionary. The report is generatd from the file COMMON.DICT. .PAGE .HEADER LEVEL COMMON__WORDS.DAT 91,000+ words used to build the common dictionary and common dictionary index. It is a combination of DICT__1__WORDS.DAT and DICT__2__WORDS.DAT. The following statistics describe the file: .LITERAL Word size and count 1 3 Word size and count 2 69 Word size and count 3 780 Word size and count 4 2952 Word size and count 5 5872 Word size and count 6 9500 Word size and count 7 12785 Word size and count 8 13800 Word size and count 9 12794 Word size and count 10 10708 Word size and count 11 8148 Word size and count 12 5690 Word size and count 13 3771 Word size and count 14 2249 Word size and count 15 1273 Word size and count 16 673 Word size and count 17 361 Word size and count 18 139 Word size and count 19 80 Word size and count 20 33 Word size and count 21 13 Word size and count 22 9 Word size and count 23 1 Word size and count 24 2 Word size and count 25 1 Word size and count 26 0 Word size and count 27 1 Word size and count 28 0 Word size and count 29 0 Word size and count 30 0 Word size and count 31 0 Word size and count 32 0 Total word count 91707 Average word length 7.75 Common Dictionary Index Statistics Pointers used 4587 pointers free 113 Byte buffer used 44752 Byte buffer free 1248 .END LITERAL .PAGE .HEADER LEVEL DICT__1__WORDS.DAT 87,000+ words that could be used to build the common dictionary and common dictionary index if a smaller dictionary is needed. This dictionary originaly came from an old LBL software tools distribution on a DECUS tape and was modified locally. The following statistics describe the file: .LITERAL Word size and count 1 3 Word size and count 2 62 Word size and count 3 711 Word size and count 4 2684 Word size and count 5 5342 Word size and count 6 8730 Word size and count 7 12027 Word size and count 8 13176 Word size and count 9 12287 Word size and count 10 10333 Word size and count 11 7914 Word size and count 12 5561 Word size and count 13 3684 Word size and count 14 2207 Word size and count 15 1256 Word size and count 16 664 Word size and count 17 354 Word size and count 18 139 Word size and count 19 80 Word size and count 20 33 Word size and count 21 13 Word size and count 22 9 Word size and count 23 1 Word size and count 24 2 Word size and count 25 1 Word size and count 26 0 Word size and count 27 1 Word size and count 28 0 Word size and count 29 0 Word size and count 30 0 Word size and count 31 0 Word size and count 32 0 Total word count 87274 Average word length 8.81 .END LITERAL .PAGE .HEADER LEVEL DICT__2__WORDS.DAT 45,000+ words that could be used to build the common dictionary and common dictionary index if a smaller dictionary is needed. The following statistics describe the file: .LITERAL Word size and count 1 0 Word size and count 2 48 Word size and count 3 602 Word size and count 4 2332 Word size and count 5 4123 Word size and count 6 6226 Word size and count 7 7503 Word size and count 8 7113 Word size and count 9 6095 Word size and count 10 4698 Word size and count 11 3107 Word size and count 12 1937 Word size and count 13 1129 Word size and count 14 520 Word size and count 15 234 Word size and count 16 80 Word size and count 17 50 Word size and count 18 14 Word size and count 19 3 Word size and count 20 0 Word size and count 21 0 Word size and count 22 0 Word size and count 23 0 Word size and count 24 0 Word size and count 25 0 Word size and count 26 0 Word size and count 27 0 Word size and count 28 0 Word size and count 29 0 Word size and count 30 0 Word size and count 31 0 Word size and count 32 0 Total word count 45814 Average word length 6.98 .END LITERAL .HEADER LEVEL EDITOR.TPU$SECTION Extended EVE editor. .HEADER LEVEL EDITOR.TPU TPU source code for the extended EVE editor. .HEADER LEVEL EXTENDED__EVE__HELP.HLB The extended EVE help library. .HEADER LEVEL EXTENDED__EVE__HELP.HLP Sorce code for the extended EVE help library. .HEADER LEVEL LINK__TPU__CALLUSER.COM DCL command file that links the TPU call user shared image TPU__CALLUSER.EXE. Because of the special nature of the link this command file is provided. None of the other programs need a special link command. .HEADER LEVEL PROJECT.DICT Sample project dictionary created by BUILD__PROJECT__DICT.EXE. .HEADER LEVEL PROJECT__WORDS.DAT Sample word list for the project dictionary. This word list includes 130+ of the most common words obtained from a word count of INFOVAX messages. This file is input to BUILD__PROJECT__DICT.EXE. .HEADER LEVEL SPELL.EXE Standalone spelling checker. .HEADER LEVEL SPELL__INCLUDE.FOR A FORTRAN include file defining the internal dictionary data structures. Used by almost every routine. .HEADER LEVEL SPELL__RV.EXE Standalone spelling checker that uses reverse video. It does not work well and only works on VT100 terminals. It was a quick test progam. It should be converted to use the VAX/VMS screen management routines. .HEADER LEVEL SPELLIB.OLB An object library containing spell checker routines. This library must be linked to almost every program. .HEADER LEVEL STATS.EXE Generates statistics from the text word files used to build dictionaries. The information generated is useful for determining the size of internal data structures that hold the dictionaries. .HEADER LEVEL TPU__CALLUSER.EXE Routines that access the dictionaries for extended EVE. .HEADER LEVEL TEST__COMMON__DICT.EXE A program that test the validity of the dictionary file built by BUILD__COMMON__DICT.EXE. Currently it does very little. .HEADER LEVEL TEST__COMMON__INDEX.EXE A program that test the validity of the dictionary index file built by BUILD__COMMON__DICT.EXE. Currently it does very little. .HEADER LEVEL TEST__PROJECT__DICT.EXE A program that test the validity of the dictionary file built by BUILD__PROJECT__DICT.EXE. Currently it does very little. .HEADER LEVEL TEST__USER__DICT.EXE A program that test the validity of the dictionary file built by BUILD__USER__DICT.EXE. Currently it does very little. .HEADER LEVEL USER.DICT Sample user dictionary built by extended EVE or BUILD__USER__DICT.EXE. .HEADER LEVEL USER__WORDS.DAT Sample word list for the user dictionary. This file is input to BUILD__USER__DICT.EXE. .HEADER LEVEL XEVE.MEM This document. Generated by RUNOFF. .HEADER LEVEL XEVE__MEMO.COM A DCL command file that builds the XEVE.MEM documentation memo. .SET LEVEL 1 .PAGE .HEADER LEVEL BUILD THE EVE SPELLING CHECKER FROM SOURCE CODE .LITERAL +----------------------------------------------------------+ + + + Show the source files needed to build the extended + + EVE editor + + + +----------------------------------------------------------+ $ DIRECTORY/COLUMN=1 Directory SYSTEMDISK:[XEVE] EDITOR.TPU EXTENDED_EVE_HELP.HLP LINK_TPU_CALLUSER.COM SPELLIB.FOR SPELL_INCLUDE.FOR TPU_CALLUSER.FOR Total of 6 files. +----------------------------------------------------------+ + + + Build the object library containing the general use + + spelling checker routines + + + +----------------------------------------------------------+ $ FORTRAN SPELLIB $ LIBRARY/CREATE/OBJECT SPELLIB SPELLIB.OBJ +----------------------------------------------------------+ + + + Build the TPU_CALLUSER shared image + + + +----------------------------------------------------------+ $ FORTRAN TPU_CALLUSER $ SET VERIFY $ @LINK_TPU_CALLUSER.COM $ LINK/SHARE/EXE=TPU_CALLUSER - TPU_CALLUSER, - SPELLIB/LIB, - SYS$INPUT/OPT PSECT=SPELLER_COMMON,LCL,NOSHR UNIVERSAL=TPU$CALLUSER $ SET NOVERIFY .END LITERAL .PAGE .LITERAL +----------------------------------------------------------+ + + + Build the extended EVE editor + + + +----------------------------------------------------------+ $ EDIT/TPU/NOJOURNAL EDITOR.TPU %TPU-S-FILEIN, 825 lines read from file SYSTEMDISK:[XEVE]EDITOR.TPU;1 Command: extend tpu * Extending TPU... Definition of TPU$LOCAL_INIT superseded at line 4 Definition of EVE_HELP superseded at line 807 Compilation completed without errors TPU extended Command: save extended tpu editor SYSTEMDISK:[XEVE]EDITOR.TPU$SECTION;1 created 162 procedures,142 variables,59 keys saved Command: quit +----------------------------------------------------------+ + + + Build the extended EVE help library + + + +----------------------------------------------------------+ $ LIBRARY/CREATE/HELP EXTENDED_EVE_HELP - _$ EXTENDED_EVE_HELP.HLP .END LITERAL .PAGE .LITERAL +----------------------------------------------------------+ + + + Show the files resulting from the build of the + + extended EVE editor + + + +----------------------------------------------------------+ $ DIRECTORY/COLUMN=1 Directory SYSTEMDISK:[XEVE] EDITOR.TPU EDITOR.TPU$SECTION EXTENDED_EVE_HELP.HLB EXTENDED_EVE_HELP.HLP LINK_TPU_CALLUSER.COM SPELLIB.FOR SPELLIB.OBJ SPELLIB.OLB SPELL_INCLUDE.FOR TPU_CALLUSER.EXE TPU_CALLUSER.FOR TPU_CALLUSER.OBJ Total of 12 files. .END LITERAL