nltk/nltk — Issue #30: Add "update" command to the downloader
Author: alexrudnick
Created: 2012-01-17 06:13:54+00:00
State: open

Add "update" command to the downloader

Migrated from http://code.google.com/p/nltk/issues/detail?id=95

earlier comments

nmadnani said, at 2010-09-20T11:57:31.000Z:

I took a stab at adding an update function to the downloader. It only updates out of date/stale packages. Can people test and let me know whether this works fine so I can commit?

StevenBird1 said, at 2010-09-30T08:17:34.000Z:

Thanks for this (NB there have been other changes to downloader.py since the revision on which this one is based, so it will be necessary to merge the changes).

I updated cmudict.zip, then ran the update option, via the download_shell. I saw a deprecation warning (object.__new__() takes no parameters), then the message: "Nothing to update", even though I have a stale version of the cmudict data installed.

(By the way, the command line interface should support an update switch.)

nmadnani said, at 2010-09-30T13:05:50.000Z:

I updated downloader.py to the latest version and merged in my changes. Although I do get the deprecation warning, I get it even with the checked in version (when do a 'd' and then an 'l') and only with Python 2.6. I think we have handled this issue before (see issue 390). I don't get any such warnings with python 2.7.

Other than the deprecation warning though, I am able to update cmudict just fine. See below:

[nmadnani@hadhafang nltk-trunk] python2.6
Python 2.6.4 (r264:75706, Feb 25 2010, 00:44:18)
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import nltk
>>> nltk.download_shell()
NLTK Downloader
---------------------------------------------------------------------------
d) Download l) List u) Update c) Config h) Help q) Quit
---------------------------------------------------------------------------
Downloader> u
nltk/__init__.py:588: DeprecationWarning: object.__new__() takes no parameters

Will update following packages (o=ok; x=cancel)
[ ] cmudict............. The Carnegie Mellon Pronouncing Dictionary (0.6)

Identifier> o
Downloading package 'cmudict' to /Users/nmadnani/nltk_data...
Unzipping corpora/cmudict.zip.

---------------------------------------------------------------------------
d) Download l) List u) Update c) Config h) Help q) Quit
---------------------------------------------------------------------------
Downloader>

nmadnani said, at 2011-03-28T04:24:19.000Z:

This still works fine for me. Should we work on this more?

StevenBird1 said, at 2011-10-10T22:17:27.000Z:

Please go ahead and commit your changes. No problem about the deprecation warning.