A WordNet Browser in Squeak (Mach I alpha)

Steve Wart swart at home.com
Wed Aug 18 15:25:40 UTC 1999


I pulled the unix distribution (but I am using NT as well).

The different distributions may have different directory structures.
Once I figured out which files to put into the "Database" directory,
I tried your original instructions, but when I typed

'house' exploreInWNet

I had no luck. It seems that the WNet class variables N, V, Adv, etc.
were getting set to nil and it would break in different places after
subsequent reinitialization attempts.

My problem is likely due to the fact that oldFileNamed: fails quietly
even though the file exists, maybe because the file was already opened
by the previous WNPOSDictionary>>directory:pos: (this could be an NT
thing).

If I modify the code as follows (i.e. to raise an error if it cannot
open the file), I get alternating error messages that it cannot open
index.noun and index.verb each time I try a WNet release/initialize
cycle.

Steve

directory: aDirectory pos: aString

	|fileName|
	pathName _ aDirectory pathName.
	pos _ aString.
	aDirectory ifNil: [^self error: 'No Directory Specified'].
	fileName _ 'index.', pos.
	(aDirectory fileExists: fileName)
		ifFalse: [self error: 'Can''t Find ', fileName.].
	(wordStream _ WNIndexStream oldFileNamed: (aDirectory fullNameFor:
fileName))
		ifNil: [self error: 'Can''t Open ', fileName.].
	fileName _ 'data.', pos.
	(aDirectory fileExists: fileName)
		ifFalse: [self error: 'Can''t Find ', fileName].
	(synsetStream _ WNDataStream oldFileNamed: (aDirectory fullNameFor:
'data.', pos))
		ifNil: [self error: 'Can''t Open ', fileName.].

> -----Original Message-----
> From: Dwight Hughes [mailto:dwighth at ipa.net]
> Sent: August 17, 1999 10:10 PM
> To: Squeak Mail List
> Cc: Andrew C. Greenberg
> Subject: Re: A WordNet Browser in Squeak (Mach I alpha)
>
>
> Ah, good - that worked. Thanks. I had assumed only a few class
> definitions were missing - obviously much more was required. :-)
>
> BTW - I'm running it on WinNT. I simply pulled down the
> WordNet_1.6.sea.bin file and used the Database directory out of it (the
> equivalent PC distribution directory suffers from the dreaded MSDOS
> limitations syndrome).
>
> -- Dwight
>
> "Andrew C. Greenberg" wrote:
> >
> > I am grateful to Dwight Hughes for pointing out that the changeset in
> > my previous posting was fragmentary.  I decline, however, his
> > gracious suggestion that I blame it on the 2.5 update -- the error
> > was entirely due to my own carelessness.
> >
> > I believe that the changeset attached here will load correctly --
> > having tested it by deleting all the classes and filing in once more.
> > I have no doubt Dwight (and others) will let me know if I blew it a
> > second time.
> >
> >
> ------------------------------------------------------------------------
> >
> >    WNet.17Aug1144pm.csName: WNet.17Aug1144pm.cs
> >                       Type: Macintosh BinHex Archive
> (application/mac-binhex40)
>





More information about the Squeak-dev mailing list