A class used to access the NLTK data server, which can be used to
download corpora and other data packages.
|
|
|
|
|
| list(self,
download_dir=None,
show_packages=True,
show_collections=True,
header=True,
more_prompt=False,
skip_installed=False) |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| incr_download(self,
info_or_id,
download_dir=None,
force=False) |
source code
|
|
|
|
|
|
|
| _download_list(self,
items,
download_dir,
force) |
source code
|
|
|
|
| _download_package(self,
info,
download_dir,
force) |
source code
|
|
|
|
download(self,
info_or_id=None,
download_dir=None,
quiet=False,
force=False,
prefix='[nltk_data] ',
halt_on_error=True,
raise_on_error=False) |
source code
|
|
|
|
| is_stale(self,
info_or_id,
download_dir=None) |
source code
|
|
|
|
| is_installed(self,
info_or_id,
download_dir=None) |
source code
|
|
|
|
|
|
|
status(self,
info_or_id,
download_dir=None)
Return a constant describing the status of the given package or
collection. |
source code
|
|
|
|
|
|
|
update(self,
quiet=False,
prefix='[nltk_data] ')
Re-download any packages whose status is STALE. |
source code
|
|
|
|
|
|
|
index(self)
Return the XML index describing the packages available from the data
server. |
source code
|
|
|
|
|
|
|
xmlinfo(self,
id)
Return the XML info record for the given item |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
INDEX_TIMEOUT = 3600
The amount of time after which the cached copy of the data server
index will be considered 'stale,' and will be re-downloaded.
|
|
|
DEFAULT_URL = 'http://nltk.googlecode.com/svn/trunk/nltk_data/...
The default URL for the NLTK data server's index.
|
|
|
INSTALLED = 'installed'
A status string indicating that a package or collection is installed
and up-to-date.
|
|
|
NOT_INSTALLED = 'not installed'
A status string indicating that a package or collection is not
installed.
|
|
|
STALE = 'out of date'
A status string indicating that a package or collection is corrupt or
out-of-date.
|
|
|
PARTIAL = 'partial'
A status string indicating that a collection is partially installed
(i.e., only some of its packages are installed.)
|
|
|
_url
The URL for the data server's index file.
|
|
|
_collections
Dictionary from collection identifier to Collection
|
|
|
_packages
Dictionary from package identifier to Package
|
|
|
_download_dir
The default directory to which packages will be downloaded.
|
|
|
_index
The XML index file downloaded from the data server
|
|
|
_index_timestamp
Time at which self._index was
downloaded.
|
|
|
_status_cache
Dictionary from package/collection identifier to status string (INSTALLED, NOT_INSTALLED, STALE, or PARTIAL).
|
|
|
_errors
Flag for telling if all packages got successfully downloaded or not.
|