[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

385.0. "DECspell DICTIONARY and THESAURUS program hack" by YALI::LASTOVICA (Norm Lastovica) Mon Jan 19 1987 20:54

(this note also appears in the DECspell notes file on PIXEL::)
    
At the risk of getting people upset, we've done some hacking
and come up with some real neat interfaces to DECspell.  Far as I
can tell, these are NOT documented (and I'm sure Nick would like to
keep it that way) and are for your INTERNAL to DIGITIAL enjoyment
ONLY.

The first program is called DICTIONARY.  Given a word, it will display
all the dictionary definitions and 'alternate words' for each definition
(this is called that word starting with "TH" that I don't remember how
to spell).

I had to hack apart the WPS kit to get the spelling stuff.  Start by
doing a BACKUP/LIST on each one of the kit save sets.  All the spell
stuff is in one place.  Just restore that one save set (via BACKUP) to 
disk.  Then, you'll need the program in the first reply.  In the program
comments, I've included the commands needed to assemble and link and
run.

Good thing DECspell is done in Fortran, it is the only language
that I know of that puts the argument types in the shared images...

I offer no support as this a pure hackery project.  However, there are
other possibilities.  I've noticed several other routines in the sharables
that I'm still (very part time) trying to figure out.  As I get time
to do other interfaces, I'll put them here.  Good luck!

1	!
	! Dictionary program.  FOR INTERNAL USE ONLY!  Steal all the files
	! from the latest WPS kit.
	!
	! assembly, link and run instructions:
	!
	!	$ define lngsplaeu sys$disk:lngsplaeu
	!	$ define lngsplaet sys$disk:lngsplaet
	!	$ define lngsplshr sys$disk:lngsplshr
	!
	!	$ bas dictionary
	!	$ link dictionary+sys$input/opt
	!	splmsgref
	!	lngsplshr/share
	!
	!	$ run dictionary
	!

	external long function lngspl$initialize_et,lngspl$lookup_et
	external long function sys$getmsg
	external long constant lngspl$_completed
	declare long sts, done

	Print "Dictionary program..."
	print

	sts = lngspl$initialize_et('LNGSPLAET')
	if (sts and 1%) = 0% then
	    gosub 10000 
	    goto 32767
	end if

    while -1%
	linput 'Enter a Word ';a$
	goto 32767 if edit$(a$,-1%) = ""

	a$ = left$(a$+space$(150%),150%)	! make it 150 bytes long
	a% = 1%					! Match case
	done,f% = 0%				! flags
	
	outs$ = space$(4096%)			! make a big string
	sts = lngspl$lookup_et(	a$,f%,a%,out1%,
				out2%,outs$,out3%,out4%,out5%)
	if sts <> lngspl$_completed then
	    gosub 10000 
	    done = -1%
	end if

	while not done
	    i% = instr(1%,outs$,'.')	! dot separates each word
	    ls$ = left$(outs$,i%)	! get the first word in the string
	    outs$ = right$(outs$,i%+1%)	! remove the first word from the string
	    done = (len(ls$) = 1%)	! is there but one character left?
	    if not done then		! no
		f% = f% + 1%		!
		print '	"'+ edit$(ls$,128%) +'"'	! print the word
		thes$ = space$(4096%)	! make a big return string
		sts = lngspl$lookup_et(	a$,f%,a%,out1%,out2%, &
					thes$,out3%,out4%,out5%)
		if sts <> lngspl$_completed then
		    gosub 10000 
		    done = -1%
		end if
		print edit$(thes$,128%)
		print
	    end if
	next
    next

10000	!
	! Print out STS and assoc. msg
	!
	mmm$ = space$(256%)
	iii% = sys$getmsg(sts by value, lll%, mmm$, 15% by value, 0% by value)
	print 'GETMSG FAILED=';iii% if (iii% and 1%)=0% 
	print left$(mmm$,lll%)
	return

32767	end
    
T.RTitleUserPersonal
Name
DateLines