Update for version 2.1 of WordNet
Brought to you by:
oliversteele
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.
Patch to support WordNet 2.1 with "instance of" relations.
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".
Missing lexnames file.
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.
A patch to correct the first patch (wordnet-2.1-update.diff).
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
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.