Improve WordNet package lookup (pattern.en)
@@ -47,6 +47,9 @@ from nltk.corpus.reader.wordnet import Synset as WordNetSynset
# Make sure the necessary corpora are downloaded to the local drive
for token in ("wordnet", "wordnet_ic", "sentiwordnet"):
+ try:
+ nltk.data.find("corpora/" + token)
+ except LookupError:
nltk.download(token, quiet = True, raise_on_error = True)
# Use the Brown corpus for calculating information content (IC)
