home *** CD-ROM | disk | FTP | other *** search
- /**************************************************************************/
- /* $VER: Guess.rexx 1.0 (29 Aug 1995) */
- /**************************************************************************
-
- This ARexx script uses AlphaSpell to guess at a word. If a wildcard pattern
- is passed, it does pattern matching on the dictionaries. Otherwise, it uses
- one of AlphaSpell's guessing routines. If an edit distance is passed as its
- second argument, it guesses by measuring edit distances. Otherwise, it uses
- a SoundEx method. This script is designed to be adapted for use with a text
- editor. To adapt it, change the "SAY" command at the end to a statement for
- inserting the word into the text of a document.
-
- **************************************************************************/
-
- IF EXISTS("libs:rexxarplib.library") THEN DO
- IF ~SHOW("L","rexxarplib.library") THEN
- CALL ADDLIB("rexxarplib.library",0,-30)
- END
- ELSE SAY "You need RexxArpLib.library"
-
- PARSE ARG word k
- k = strip(k)
-
- IF VERIFY(word, "?*\[]!^", "Match") ~= 0 THEN
- com = "AlphaSpell -Po T:List -d" GetENV("DDIR") "-w" word GetENV("Dict")
- ELSE IF DATATYPE(k) = "NUM" THEN
- com = "AlphaSpell -Go T:List -n" k "-d" GetENV("DDIR") "-w" word GetENV("Dict")
- ELSE
- com = "AlphaSpell -Go T:List -d" GetENV("DDIR") "-w" word GetENV("Dict")
- ADDRESS COMMAND com
-
- CALL Open(input,"T:List","R")
- n = 0
- DO UNTIL EOF(input)
- n = n + 1
- list.n = Readln(input)
- END
- CALL Close(input)
-
- word = RequestList(1, n - 1, list, 100, 50, 300, 150,,"SORT")
- SAY word
-
- EXIT
-