Share

PyWordNet

Tracker: Patches

5 Update for version 2.1 of WordNet - ID: 1481441
Last Update: Comment added ( cerin )

WordNet 2.1 introduces the distinction between hyponyms
that are instances and hyponyms that are classes.
Earlier all hyponym relations were tagged with a '@' in
the WordNet database/lexicographer files. Now,
however, an "instance of" relation is signified with a
'@i' tag. This required an update of the wordnet.py
script. A small patch should be attached.


Martin Thorsen Ranang ( ranang ) - 2006-05-03 22:50

5

Open

None

Nobody/Anonymous

None

None

Public


Comments ( 4 )




Date: 2006-09-25 00:32
Sender: cerin

Logged In: YES
user_id=721519

After applying those patches, it seems to import correctly,
but I get the following error/warnings on import:

Exception exceptions.AttributeError: "DbfilenameShelf
instance has no attribute 'writeback'" in ignored

I'm on Linux, FC5.


Date: 2006-05-09 22:30
Sender: cerin

Logged In: YES
user_id=721519

After applying those patches on Windows, I still get the error:
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more
information.
>>> from wordnet import *
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "C:\Program
Files\Python24\lib\site-packages\wordnet.py", line 776, in ?
setupLexnames()
File "C:\Program
Files\Python24\lib\site-packages\wordnet.py", line 772, in se
tupLexnames
for l in open(WNSEARCHDIR+'/lexnames').readlines():
IOError: [Errno 2] No such file or directory: 'C:\\Program
Files\\WordNet\\2.0\\
dict/lexnames'

For Windows, you have to replace all "C:\\Program
Files\\WordNet\\2.0" with "C:\\Program Files\\WordNet\\2.1"
in wordnet.py

I still get the following exceptions when I import wordnet,
but afterwards I'm able successfully access Wordnet.
Exception exceptions.AttributeError: "DbfilenameShelf
instance has no attribute
'writeback'" in ignored
Exception exceptions.AttributeError: "DbfilenameShelf
instance has no attribute
'writeback'" in ignored
Exception exceptions.AttributeError: "DbfilenameShelf
instance has no attribute
'writeback'" in ignored
Exception exceptions.AttributeError: "DbfilenameShelf
instance has no attribute
'writeback'" in ignored


Date: 2006-05-04 07:13
Sender: ranang

Logged In: YES
user_id=1309449

I just discovered a problem with the patch I submittet. It
does not handle hyponyms correctly. Therefore, I attach a
new patch with this posting that is supposed to be applied
after the first patch. I'm sorry for any inconvenience this
may have caused.


Date: 2006-05-03 22:59
Sender: ranang

Logged In: YES
user_id=1309449

I also noted someone had trouble with the missing lexnames
file, so I believe have generated a (hopefully correct) new
one, according to lexnames(5) (the man page). I will attach
that file too. Just save it in the $WNHOME/dict directory
and rename it to "lexnames".



Log in to comment.




Attached Files ( 3 )

Filename Description Download
wordnet-2.1-update.diff Patch to support WordNet 2.1 with "instance of" relations. Download
wordnet-2.1-lexnames Missing lexnames file. Download
wordnet-2.1-update2.diff A patch to correct the first patch (wordnet-2.1-update.diff). Download

Changes ( 3 )

Field Old Value Date By
File Added 176798: wordnet-2.1-update2.diff 2006-05-04 07:13 ranang
File Added 176766: wordnet-2.1-lexnames 2006-05-03 22:59 ranang
File Added 176765: wordnet-2.1-update.diff 2006-05-03 22:50 ranang