I'm looking at a G4G page about wordnet, and see from nltk.corpus import wordnet. So I'm trying things out, but want to look at the documentation and see the methods etc. available, but can't seem to find nltk.corpus.wordnet, only nltk.corpus.reader.wordnet.
Then, I tried:
from nltk.corpus import wordnet as WD1
from nltk.corpus.reader import wordnet as WD2
print(WD1 == WD2)
print(WD1 is WD2)
and got:
False
False
Could someone help me navigate nltk/wordnet's structure?
WD1is instance ofnltk.corpus.util.LazyCorpusLoaderthat transform itself intoWD2.WordNetCorpusReaderafter the first time it accessed :output:
The
nltk.corpus.reader.wordnetis an interface for WordNet that contain readers and related tools forWordNet.When import
wordnetfromnltk.corpusit automatically create instance of a LazyCorpusLoader then it transform itself toWordNetCorpusReaderreader instances that can be used to access theWordNet.You can find the documentation for
nltk.corpus.wordnetin Sample usage for wordnet