1

I am trying to load wordnet 1.6 and 3.0 dictionary but I keep getting an error.

import os
import xml.etree.ElementTree as ET
from xml.etree.ElementTree import *
import nltk
from nltk.data import find
from nltk.corpus import WordNetCorpusReader
from xml.dom import minidom

WN16 = WordNetCorpusReader(nltk.data.find('resources/wordnet-1.6/dict'))
WN = WordNetCorpusReader(nltk.data.find('resources/WordNet-3.0/dict'))

Error

 WN = WordNetCorpusReader(nltk.data.find('resources/WordNet-3.0/dict'))
  File "/Library/Python/2.7/site-packages/nltk/data.py", line 618, in find
    raise LookupError(resource_not_found)
LookupError: 
**********************************************************************
  Resource u'resources/WordNet-3.0/dict' not found.  Please use
  the NLTK Downloader to obtain the resource:  >>> nltk.download()
  Searched in:
    - '/Users/ronald/nltk_data'
    - '/usr/share/nltk_data'
    - '/usr/local/share/nltk_data'
    - '/usr/lib/nltk_data'
    - '/usr/local/lib/nltk_data'

Any help on how to solve this issue would be greatly appreciated. Thanks.

user3078335
  • 781
  • 4
  • 13
  • 24
  • 1
    Have you run `nltk.download()`? – EWit Jan 26 '15 at 20:37
  • already checked similar solved issues on SO as http://stackoverflow.com/questions/13965823/resource-corpora-wordnet-not-found-on-heroku and http://stackoverflow.com/questions/4867197/failed-loading-english-pickle-with-nltk-data-load ? – aberna Jan 26 '15 at 20:40
  • @aberna thanks! Those were very helpful – user3078335 Jan 26 '15 at 20:44

0 Answers0