home *** CD-ROM | disk | FTP | other *** search
- /*rx
- * Spell.rexx --- program to spell check a word using the ISpell server
- * from CLI.
- *
- * Copyright © 1989, 1992 Loren J. Rittle
- * Use as you will, just document your changes and keep my copyright
- * notice intact. Feel free to mail enhancements to me.
- *
- * Loren J. Rittle
- * rittle@comm.mot.com
- * Wed May 13 05:36:38 1992
- */
-
- options results
-
- if left(address(), 4) ~== 'WSH_' then
- address command
-
- if words(arg(1)) = 0 then
- do
- say 'Usage: spell word1 word2 ...'
- exit 5
- end
-
- if ~show(ports, 'IRexxSpell') then
- do
- 'run <nil: >nil: ispell -r >nil: <nil:'
- waitforport 'IRexxSpell'
- end
-
- do i = 1 to words(arg(1))
- item = word(arg(1),i)
- address 'IRexxSpell' check item
- r = result
- r1 = substr(r,1,1)
- select
- when r1 = '*' then nop
- when r1 = '+' then nop
- when r1 = '&' then
- if words(r) = 2 then
- say "The word '"||item||"' is not found. Try this word:" substr(r,3)
- else
- say "The word '"||item||"' is not found. Try these words:" substr(r,3)
- when r1 = '#' then say "Nothing even close to '"||item||"' found in dictionary!"
- otherwise say "For the word '"||item||"' I got" r
- end
- end
-
- exit 0
-