class documentation

To see the API documentation for this lazily loaded corpus, first run corpus.ensure_loaded(), and then run help(this_corpus).

LazyCorpusLoader is a proxy object which is used to stand in for a corpus object before the corpus is loaded. This allows NLTK to create an object for each corpus, but defer the costs associated with loading those corpora until the first time that they're actually accessed.

The first time this object is accessed in any way, it will load the corresponding corpus, and transform itself into that corpus (by modifying its own __class__ and __dict__ attributes).

If the corpus can not be found, then accessing this object will raise an exception, displaying installation instructions for the NLTK data package. Once they've properly installed the data package (or modified nltk.data.path to point to its location), they can then use the corpus object without restarting python.

Parameters
nameThe name of the corpus
reader_clsThe specific CorpusReader class, e.g. PlaintextCorpusReader, WordListCorpusReader
nltk_data_subdirThe subdirectory where the corpus is stored.
*argsAny other non-keywords arguments that reader_cls might need.
kargsAny other keywords arguments that reader_cls might need.
Method __getattr__ Undocumented
Method __init__ Undocumented
Method __repr__ Undocumented
Instance Variable __class__ Undocumented
Instance Variable __dict__ Undocumented
Instance Variable __name__ Undocumented
Instance Variable subdir Undocumented
Method __load Undocumented
Method _unload Undocumented
Instance Variable __args Undocumented
Instance Variable __kwargs Undocumented
Instance Variable __name Undocumented
Instance Variable __reader_cls Undocumented
def __getattr__(self, attr): (source)

Undocumented

def __init__(self, name, reader_cls, *args, **kwargs): (source)

Undocumented

def __repr__(self): (source)

Undocumented

__class__ = (source)

Undocumented

__dict__ = (source)

Undocumented

__name__ = (source)

Undocumented

Undocumented

def __load(self): (source)

Undocumented

def _unload(self): (source)

Undocumented

Undocumented

__kwargs = (source)

Undocumented

Undocumented

__reader_cls = (source)

Undocumented