home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-387-Vol-3of3.iso
/
e
/
epmmac2.zip
/
EPMLEX.E
< prev
next >
Wrap
Text File
|
1992-12-18
|
31KB
|
754 lines
/*
╔════════════════════════════════════════════════════════════════════════════╗
║ What's it called: EPMLEX.E ║
║ ║
║ What does it do : Spell checking and Synonym support for the EPM editor. ║
║ ║
║ There are two major components to spell and synonym ║
║ checking in EPM. The first and most important is the ║
║ actual word verification and word/dictionary lookup. ║
║ This is done by the internal EPM opcode, "lexam". ║
║ This opcode can take on the variations indicated by ║
║ the LXF constants defined below. ║
║ ║
║ The second most important part to word checking is the ║
║ presentation of the results. This is neatly done in ║
║ EPM using a PM list box. E has an internal list dialog ║
║ accessible through the 'listbox' function. See ║
║ STDCTRL.E for details on the 'listbox' function. ║
║ ║
║ Who and When : Larry Margolis, 11/91 ║
║ Updated from the original ║
║ EPMLEX.E done by: C.Maurer, R.Yozzo, Gennaro Cuomo, and Larry Margolis ║
║ 1/89 - 10/90 ║
╚════════════════════════════════════════════════════════════════════════════╝
*/
; Customizing information: Any of the following customizing constants can
; be overridden by including the appropriate definition after a CONST statement
; in your MYCNF.E.
;
; Example of customizing: include the following lines in your MYCNF.E
; (with the ';' deleted from the beginning of each line).
;
; const -- Customizations for EPMLEX:
; RESPECT_case_for_addenda = 0 -- Ignore case of addenda words.
; my_ADDENDA_FILENAME= 'd:\doc\margoli.adf' -- I keep these in my
; my_DICTIONARY_FILENAME= 'd:\doc\us.dct' -- d:\doc directory.
; Can also have multiple dictionaries, separated by spaces - all will be loaded:
; my_DICTIONARY_FILENAME= 'd:\doc\us.dct d:\doc\medical.dct d:\doc\legal.dct'
compile if not defined(SMALL) -- If SMALL not defined, then being separately compiled
include 'stdconst.e'
define INCLUDING_FILE = 'EPMLEX.E'
tryinclude 'MYCNF.E' -- Include the user's configuration customizations.
compile if not defined(SITE_CONFIG)
const SITE_CONFIG = 'SITECNF.E'
compile endif
compile if SITE_CONFIG
tryinclude SITE_CONFIG
compile endif
const
compile if not defined(SPELL_SUPPORT) -- Must set here, since set to 0 in ENGLISH.E
compile if EVERSION >= 5
SPELL_SUPPORT = 'DYNALINK' -- New default
compile else
SPELL_SUPPORT = 0
compile endif
compile endif
compile if not defined(NLS_LANGUAGE)
const NLS_LANGUAGE = 'ENGLISH'
compile endif
include NLS_LANGUAGE'.e'
compile endif
const
compile if not defined(PROOF_DIALOG_FIXED)
PROOF_DIALOG_FIXED = 0 -- 1 if dialog should stay in one spot
compile endif
compile if not defined(ADDENDASUPPORT)
ADDENDASUPPORT = 1 -- 1 if addenda support
compile endif
compile if ADDENDASUPPORT
compile if not defined(RESPECT_case_for_addenda)
RESPECT_case_for_addenda = 1 /* If addenda entries are to be */
compile endif /* placed in the addenda without */
/* modifying their case, then */
/* this variable should be 1 */
/* Otherwise, it should be 0 */
compile endif -- ADDENDASUPPORT
const
; Functions
compile if EVERSION >= 5.50 -- Use the new function numbers
LXFINIT = 0 /* Initialize */
LXFTERM = 1 /* Terminate */
LXFGDIC = 2 /* Pickup Dictionary */
LXFFDIC = 3 /* Drop Dictionary */
LXFSETADD = 4 /* Set Addenda Language Type */
LXFAD2TRS = 5 /* Add to Transient Addenda */
LXFREDTRS = 6 /* Read from Transient Addenda */
LXFSAVTRS = 7 /* Save Transient Addenda */
LXFVERFY = 8 /* Verification */
LXFSPAID = 9 /* Spelling Aid */
LXFHYPH =10 /* Hyphenation */
LXFDHYPH =11 /* Dehyphenation */
LXFSYN =12 /* Synonym */
LXFAMUGDIC=255 /* Addenda Pickup Dictionary */
/* (Pseudo-op; calls LXFGDIC internally) */
compile else -- The old way; uses strings
LXFINIT = 'I' -- Initialize
LXFTERM = 'T' -- Terminate
LXFGDIC = 'PI' -- Pickup Dictionary
LXFFDIC = 'DR' -- Drop Dictionary
LXFAD2TRS = 'ADDI' -- Add(ition) to Transient Addenda
LXFVERFY = 'V' -- Verification
LXFSPAID = 'SP' -- Spelling Aid
LXFSYN = 'SY' -- Synonym
LXFAMUGDIC= 'ADDE' -- Addenda Pickup Dictionary
compile endif
; Return codes
LXRFGOOD = 0000 /* Function Successful: Good Return Code */
LXRFNFND = 0100 /* Function Unsuccessful: Word Not Found */
LXRFDUPD = 0107 /* Function Unsuccessful: Duplicate Dictionary */
LXRFINIT = 0200 /* PC LEXAM Not Initialized: Control Block/Parameter Err */
LXRFIFCN = 0201 /* Invalid Function */
definit
universal addenda_has_been_modified
universal ADDENDA_FILENAME
universal DICTIONARY_FILENAME
universal Dictionary_loaded
; Note: don't initialize the universals here for EPM if SPELL_SUPPORT =
; 'DYNALINK'; it will be done in STDCNF so that this won't override the
; config info read from the .INI file.
compile if EVERSION < 5 or SPELL_SUPPORT <> 'DYNALINK'
compile if defined(my_ADDENDA_FILENAME)
ADDENDA_FILENAME= my_ADDENDA_FILENAME
compile else
ADDENDA_FILENAME= 'c:\lexam\lexam.adl'
compile endif
compile if defined(my_DICTIONARY_FILENAME)
DICTIONARY_FILENAME= my_DICTIONARY_FILENAME
compile else
DICTIONARY_FILENAME= 'c:\lexam\us.dct'
compile endif
compile endif
addenda_has_been_modified=0
Dictionary_loaded = 0
/*
╔════════════════════════════════════════════════════════════════════════════╗
║ Synonym Support ║
╚════════════════════════════════════════════════════════════════════════════╝
*/
/*
┌────────────────────────────────────────────────────────────────────────────┐
│ What's it called: syn │
│ │
│ What does it do : The syn command uses E's lexam support to retrieve │
│ possible synonyms for a specified word. │
│ If synonyms are found a │
│ PM list box is shown containing the possible new words. │
│ │
└────────────────────────────────────────────────────────────────────────────┘
*/
defc syn =
if load_lexam() then
return
endif
call pbegin_word()
call synonym()
call drop_dictionary()
/*
┌────────────────────────────────────────────────────────────────────────────┐
│ What's it called: synonym() │
│ │
│ What does it do : checks the next word on a line for its possible synonyms.│
│ possible synonyms for a specified word. │
│ If synonyms are found a │
│ PM list box is shown containing the possible new words. │
│ │
└────────────────────────────────────────────────────────────────────────────┘
*/
defproc synonym()
getline line /* get the current line */
if line<>'' then /* if it is NOT blank */
i=.col /* get the current column number */
l=pos(' ',line,.col) /* get possible word */
if l=0 then /* could this be a word??? */
l=length(line)+1
if l<i then l=i endif
endif
wrd=strip(substr(line,i,l-i)) /* extract word candidate */
oldwordlen=length(wrd) /* save the length of the word */
result=lexam(LXFVERFY,wrd) /* authenticate word using lexam */
if result and wrd<>'' then /* was it a success??? */
call strippunct(wrd,l,i)
.col=.col+i-1
result = lexam(LXFVERFY,wrd)
endif
if(result <> LXRFGOOD) then /* was it a success ??? */
sayerror NO_MATCH__MSG '<'wrd'>' /* NO */
return '' /* exit function */
endif
/* It's a word!!! */
/* get list of synonyms using lex*/
parse value lexam(LXFSYN,wrd) with 2 '/' result
if result='' then
sayerror NO_SYN__MSG '<'wrd'>'
return ''
endif
do forever
newword = listbox(SYNONYMS__MSG,'/'result,'/'REPLACE__MSG'/'CANCEL__MSG'/'HELP__MSG'/')
if newword<>3 then leave; endif
-- help was pressed
'helpmenu 14002'
return ''
enddo
if newword<>'' then
replaceline leftstr(line,.col-1)||newword||substr(line,l)
return length(newword)-oldwordlen
endif
endif
/*
╔════════════════════════════════════════════════════════════════════════════╗
║ Spell Checking Support ║
╚════════════════════════════════════════════════════════════════════════════╝
*/
/*
┌────────────────────────────────────────────────────────────────────────────┐
│ What's it called: proof() │
│ │
│ What does it do : The proof command uses E's lexam support to spell check │
│ either the next word or a given word. If a misspelled│
│ word is encountered, a │
│ PM list box is shown containing the possible corrections.│
│ syntax: proof [word] │
│ - if 'word' is not specified, proof searchs for │
│ the next word (after the cursor) and checks it. │
└────────────────────────────────────────────────────────────────────────────┘
*/
defc proof
universal ADDENDA_FILENAME
if load_lexam() then
return
endif
if arg(1)<>'' then
call proof1(arg(1))
else
call proof2()
endif
compile if ADDENDASUPPORT
if addenda_filename<>'' then
call maybe_save_addenda()
endif
compile endif
call drop_dictionary()
if arg(1)='' then
sayerror DONE__MSG
endif
/*
┌────────────────────────────────────────────────────────────────────────────┐
│ What's it called: proof2() │
│ │
│ What does it do : Start at the current cursor position, locate the next │
│ word, and check the spelling of that word. The spelling│
│ of each word is done by calling the lexam function. │
│ The 'lexam' fuction is a internal │
│ opcode that uses the dynalink feature to access the │
│ LEXAM.DLL │
│ │
└────────────────────────────────────────────────────────────────────────────┘
*/
defproc proof2
script_file_type=AMU_script_verification()
--@@ If there's a line-marked area in the current file, proof only in there.
firstline=max(.line,1); lastline=.last; what = 'file'
if marktype() then /* if no mark, default to entire file */
getfileid curfileid
getmark fl,ll,fc,lc,markfileid
if markfileid = curfileid then
firstline=fl; lastline=ll
what = 'marked area'
endif
endif
partial_lines = marktype()='BLOCK' | marktype()='CHAR'
/* start checking at next word...*/
;getline line
;.col=1
;if leftstr(line,1)==' 'then
; tabword
;endif
if partial_lines then .col=fc; else .col=1; endif
firstline
if substr(textline(firstline), .col, 1)=' ' then tabword; endif
for zz= firstline to lastline --@@
zz /* advance to next (new) line */
getline line
sayerror 'Spell Checking 'what'...'
loop
if partial_lines then
if .col>lc & (zz=lastline | marktype()='BLOCK') then
if marktype()='BLOCK' then .col=fc; endif
leave
endif
endif
l=pos(' ',line,.col) /* find first word */
if not l then /* no more words on this line... */
l=length(line)+1 /* or there is only one word on */
if l<=.col then /* the line... */
if marktype()='BLOCK' then .col=fc; else .col=1; endif
leave
endif
endif
wrd=substr(line,.col,l-.col) /* extract word from line */
result = lexam(LXFVERFY,wrd) /* verify word using lexam */
if result and wrd<>'' then /* was it a success??? */
/* YES, ignore script tags */
if script_file_type and
(pos(leftstr(wrd,1),':&.') or pos(substr(line,max(.col-1,1),1),':&')) then
result=0
if leftstr(wrd,1)=':' then
newl=pos('.',line,.col)
if newl then
l=newl
endif
endif
else /* strip punctuation and try again */
call strippunct(wrd,l,i)
.col=.col+i-1
result = lexam(LXFVERFY,wrd)
endif
endif
if result and wrd<>'' then
result = lexam(LXFVERFY,wrd)
if result and wrd<>'' then
-- t=-3 means help was requested, so call spellword again.
t=-3
do while t=-3
compile if ADDENDASUPPORT
t=spellword('/~Next/~Temp. Add') -- spell check the word
compile else
t=spellword('/~Next') -- spell check the word
compile endif
enddo
if t=0 then -- error occured
return 0
endif
if t>0 then
l=l + t - 100
endif
if t=-4 then -- Edit was selected.
l=-1 -- so .col won't change; recheck from current point
endif
getline line
endif
endif
.col=l+1
endloop
endfor
compile if PROOF_DIALOG_FIXED
define DIALOG_POSN = ', -2, .windowwidth'
compile else
define DIALOG_POSN = ' '
compile endif
/*
┌────────────────────────────────────────────────────────────────────────────┐
│ What's it called: spellword() │
│ │
│ What does it do : Check the word at the cursor position, removing │
│ punctuation characters. It is assumed that the cursor │
│ is positioned at the beginning of the word. (Used by │
│ proof2 and proofword.) If it's a valid word then check │
│ the spelling of the word using the lexam opcode. If a │
│ valid result is returned place it in a PM list box using │
│ the 'listbox' procedure. Returns the length of the word │
│ found. The optional argument is a string containing a │
│ button name. E.g., '/Next' │
└────────────────────────────────────────────────────────────────────────────┘
*/
defproc spellword
getline line /* ignore script tags */
if line<>'' then /* if the line is not empty... */
i=.col /* save the cursor column */
l=pos(' ',line,.col) /* get next word after cursor */
if l=0 then /* is it a word??? */
l=length(line)+1
if l<i then l=i endif
endif
wrd=strip(substr(line,i,l-i)) /* extract word from line */
result = lexam(LXFVERFY,wrd) /* verify word */
if result and wrd<>'' then /* was it a success */
call strippunct(wrd,l,i) /* strip punctuation/ try again */
.col=.col+i-1 /* move to next column */
result = lexam(LXFVERFY,wrd) /* try word verification again */
endif
if result and wrd<>'' then /* was it a success */
oldwordlen=length(wrd) /* yes it's a word..... */
/* use lexam to spell check word*/
refresh
parse value lexam(LXFSPAID,wrd) with 2 '/' result
if rc>=LXRFINIT then
sayerror LOOKUP_FAILED__MSG '<' wrd '>'
return -1 -- next word
else
if result='' then
result='*Nothing Found*'
endif
oldcol = .col; .col = .col + oldwordlen; .col = oldcol;
compile if EVERSION < '5.50'
refresh
sayat wrd, .cursory, .cursorx,
.textcolor%16+(.textcolor // 16)*16, oldwordlen
compile else
circleit 2, .line, .col, .col+oldwordlen-1, 1 -- color irrelevant now
refresh -- Refresh required to display circle
compile endif
compile if ADDENDASUPPORT
newword=listbox(PROOF__MSG '<'wrd'>', '/'result,
'/'REPLACE__MSG'/'CANCEL__MSG||arg(1)'/'ADD__MSG'/'EDIT__MSG'.../'HELP__MSG $DIALOG_POSN) -- put result in PM list box
if arg(1)='' then
butlist='7 7 3 4 5' -- Next; Temp. Add; Add; Edit; Help
else
butlist='3 4 5 6 7' -- Next; Temp. Add; Add; Edit; Help
endif
compile else
newword=listbox(PROOF__MSG '<'wrd'>','/'result,'/'REPLACE__MSG'/'CANCEL__MSG ||arg(1)'/'EDIT__MSG'.../'HELP__MSG $DIALOG_POSN) -- put result in PM list box
if arg(1)='' then
butlist='7 7 7 3 4' -- Next; Temp. Add; Add; Edit; Help
else
butlist='3 7 7 4 5' -- Next; Temp. Add; Add; Edit; Help
endif
compile endif
parse value butlist with but_next but_temp_add but_add but_edit but_help
if newword=but_help then
'helpmenu 14000'
return -3 -- do line over again
endif
if newword=but_edit then
newword=entrybox(REPLACEMENT__MSG '<'wrd'>','/'REPLACE__MSG'/'CANCEL__MSG,wrd)
if newword='' then
return -1 -- next word
endif
replaceline leftstr(line,.col-1)||newword||substr(line,l)
refresh
;; return -100 - (length(newword)-oldwordlen) -- Don't care about new len.
return -4 -- re-check line
endif
if newword='*Nothing Found*' then
return -1
endif
compile if EVERSION < '5.50'
sayat wrd, .cursory, .cursorx, .textcolor, oldwordlen
compile else
; refresh -- maybe can leave out...
compile endif
if newword=but_next then -- goto next word
return -1
endif
compile if ADDENDASUPPORT
if newword=but_temp_add then -- temporary addenda (just for this PROOF session)
compile if RESPECT_CASE_FOR_ADDENDA
call lexam(LXFAD2TRS, wrd)
compile else
call lexam(LXFAD2TRS,lowcase(wrd))
compile endif
return -1
endif
if newword=but_add then -- addenda
call AMU_addenda_addition_processing(wrd)
return -1
endif
compile endif
if newword<>'' then /* was it a valid result ??? */
/* replace word in line */
replaceline leftstr(line,.col-1)||newword||substr(line,l)
compile if EVERSION < 5.50
refresh
compile endif
return 100 + length(newword)-oldwordlen
; return -1
endif
endif
else
--.messageline='word is spelled correctly'
return -2
endif
endif
return 0
/*
┌────────────────────────────────────────────────────────────────────────────┐
│ What's it called: proof1() │
│ │
│ What does it do : Takes a word argument and looks it up in the lexam │
│ dictionary using the 'lexam' opcode. │
│ If the word is found a list box is presented with the │
│ possible correct word choices. │
└────────────────────────────────────────────────────────────────────────────┘
*/
defproc proof1( wrd )
result = lexam(LXFVERFY,wrd) /* first off, is it a word? */
if result then /* well is it??? */
result = lexam(LXFSPAID,wrd) /* YES, now check it with lexam*/
parse value result with .'/' result /* remove first word */
if rc>=LXRFINIT then
sayerror LOOKUP_FAILED__MSG '<' wrd '>'
else
if result='' then
result='*Nothing Found*'
endif
do forever
compile if ADDENDASUPPORT
newword=listbox(PROOF_WORD__MSG,'/'result,'/'REPLACE__MSG'/'EXIT__MSG'/'ADD__MSG'/'HELP__MSG) /* put result in PM list box */
if newword='3' then -- addenda
call AMU_addenda_addition_processing(wrd)
return -1
endif
if newword<>4 then leave; endif
compile else
newword=listbox(PROOF_WORD__MSG,'/'strip(result),'/'REPLACE__MSG'/'EXIT__MSG'/'HELP__MSG) /* put result in PM list box */
if newword<>3 then leave; endif
compile endif
'helpmenu 14001'
enddo
if newword='*Nothing Found*' then
return
endif
return newword
endif
endif
/*
╔════════════════════════════════════════════════════════════════════════════╗
║ Addenda Support ║
╚════════════════════════════════════════════════════════════════════════════╝
*/
compile if ADDENDASUPPORT
/*
┌────────────────────────────────────────────────────────────────────────────┐
│ What's it called: maybe_save_addenda │
│ │
│ What does it do : │
│ │
└────────────────────────────────────────────────────────────────────────────┘
*/
; Addenda support commands
defproc maybe_save_addenda
universal addenda_has_been_modified
universal AMU_addenda_file_identification
universal ADDENDA_FILENAME
; if addenda_has_been_modified then
-- sayatbox 'saving addenda 'ADDENDA_FILENAME
if AMU_addenda_file_identification<>'' then
getfileid AMU_current_file_identification
rc = 0
activatefile AMU_addenda_file_identification
if not rc then
if .modify then 'xcom save'; endif
;; 'xcom quit'
endif
-- sayerror 'addenda file filed'
activatefile AMU_current_file_identification
endif
addenda_has_been_modified=0
-- sayerror 0
; endif
;defc AMU_addenda_pickup
; universal ADDENDA_FILENAME
; call lexam(LXFAMUGDIC,ADDENDA_FILENAME)
;defc AMU_addenda_addition
; call lexam(LXFAD2TRS,arg(1))
defproc AMU_addenda_processing
universal AMU_addenda_file_identification
universal ADDENDA_FILENAME
getfileid AMU_current_file_identification
'xcom e' ADDENDA_FILENAME
-- sayerror 'addenda file loaded'
if not rc or rc = sayerror('New file') then
getfileid AMU_addenda_file_identification
else
AMU_addenda_file_identification =''
sayerror BAD_ADDENDA__MSG ADDENDA_FILENAME 'rc=' rc
stop
endif
.visible=0 -- hidden file
activatefile AMU_current_file_identification
if AMU_addenda_file_identification <>'' then
for i = 1 to AMU_addenda_file_identification.last
getline line,i,AMU_addenda_file_identification
if upcase(leftstr(line, 8))='.DU ADD ' then
line=substr(line,9)
endif
do while line <> ''
parse value line with wrd line
compile if RESPECT_CASE_FOR_ADDENDA
call lexam(LXFAD2TRS,wrd)
compile else
call lexam(LXFAD2TRS,lowcase(wrd))
compile endif
enddo
endfor
endif
defproc AMU_addenda_addition_processing(AMU_addenda_entry)
universal addenda_has_been_modified
universal AMU_addenda_file_identification, ADDENDA_FILENAME
addenda_has_been_modified=1
compile if not RESPECT_CASE_FOR_ADDENDA
AMU_addenda_entry=lowcase(AMU_addenda_entry)
compile endif
call lexam(LXFAD2TRS,AMU_addenda_entry)
if ADDENDA_FILENAME<>'' & AMU_addenda_file_identification<>'' then
insertline AMU_addenda_entry,AMU_addenda_file_identification.last+1,AMU_addenda_file_identification
endif
compile endif -- ADDENDASUPPORT
; The following is a script file type verification algorithm
; suggested by Larry Margolis. (Thanks, Larry)
defproc AMU_script_verification()
ext=filetype()
compile if defined(my_SCRIPT_FILE_TYPE)
return ext='SCR' or ext='SCT' or ext='SCRIPT' or ext='IPF' or ext=my_SCRIPT_FILE_TYPE
compile else
return ext='SCR' or ext='SCT' or ext='SCRIPT' or ext='IPF'
compile endif
/*
╔════════════════════════════════════════════════════════════════════════════╗
║ General Lexam Support ║
╚════════════════════════════════════════════════════════════════════════════╝
*/
defproc load_lexam
universal DICTIONARY_FILENAME
universal ADDENDA_FILENAME
universal Dictionary_loaded
result = lexam(LXFINIT)
if result<>LXRFGOOD and result<>LXRFIFCN then
if result='febe' then -- x'febe' = -322 = sayerror('Dynalink: unrecognized library name')
sayerror sayerrortext(-322) LEXAM_DLL'.DLL'
return 1
endif
sayerror INIT_ERROR__MSG
endif
dictlist=DICTIONARY_FILENAME
do while dictlist <> ''
parse value dictlist with dictionary dictlist
result=lexam(LXFGDIC, dictionary)
if result>=LXRFNFND & result<>LXRFDUPD then -- Duplicate Dictionary; didn't unload?
if exist(dictionary) then
sayerror BAD_DICT__MSG '"'dictionary'";' ERROR__MSG result
else
sayerror NO_DICT__MSG '"'dictionary'"'
endif
return 1
endif
enddo
Dictionary_loaded = 1
compile if ADDENDASUPPORT
if ADDENDA_FILENAME<>'' then
call lexam(LXFAMUGDIC,ADDENDA_FILENAME)
call AMU_addenda_processing()
endif
compile endif
return 0
defproc drop_dictionary
universal DICTIONARY_FILENAME
universal ADDENDA_FILENAME
universal Dictionary_loaded
dictlist=DICTIONARY_FILENAME
do while dictlist <> ''
parse value dictlist with dictionary dictlist
call lexam(LXFFDIC, dictionary);
enddo
compile if ADDENDASUPPORT
if ADDENDA_FILENAME<>'' then
call lexam(LXFFDIC,ADDENDA_FILENAME);
endif
compile endif
call lexam(LXFTERM)
Dictionary_loaded = 0
defproc strippunct(var wrd,var l,var i)
-- Make this a variable, not a constant. to save space.
punctuation ='~!@#$¢£¥%^&*()_+|`1234567890-=\{}[]:";''<>?,./¬─═╔╗╚╝┌┐└┘║╦╠╣╩╬┬├┤┴┼│'
/* strip leading and trailing punctuation and try again*/
i=verify(wrd,punctuation)
if i then
l=l-length(wrd)
wrd=substr(wrd,i)
j=verify(wrd,punctuation,'m')
if j then
wrd=leftstr(wrd,j-1)
else
j=length(wrd)+1
endif
l=l+j+i-2
else
i=length(wrd)+1
endif
defc proofword,verify
universal ADDENDA_FILENAME
if load_lexam() then
return
endif
call pbegin_word()
spellrc = spellword('')
compile if ADDENDASUPPORT
if addenda_filename<>'' then
call maybe_save_addenda()
endif
compile endif
call drop_dictionary()
if -2 = spellrc then
sayerror SPELLED_OK__MSG
endif
defc dict
universal DICTIONARY_FILENAME
dictlist = arg(1)
if dictlist='' then
sayerror DICTLIST_IS__MSG DICTIONARY_FILENAME
return
endif
do while dictlist <> ''
parse value dictlist with dictionary dictlist
if not exist(dictionary) then
sayerror FILE_NOT_FOUND__MSG '"'dictionary'"; 'DICT_REMAINS__MSG DICTIONARY_FILENAME
return
endif
enddo
DICTIONARY_FILENAME = arg(1)