Commit 401dac68 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

add component/nltk.

* patch nltk egg so that the default data location is (buildout_directory)/parts/nltk-data without explicitly specifing by NLTK_DATA environment variable.
* download collection can be overridden like 'collection = aaa bbb ccc'.

/ref http://community.slapos.org/forum/NLTK-Buildout--Download-and-install-nltk_data

/cc @klaus, @Kreisel 

/reviewed-on !58
parent 7eac3f1c
[nltk]
recipe = zc.recipe.egg
eggs = nltk
interpreter = py-nltk
nltk-patches = ${:_profile_base_location_}/nltk-data-path.patch#8719f78f05ac70752b4e64fe086e36e2
nltk-patch-options = -p1
[nltk-data]
recipe = plone.recipe.command
location = ${buildout:parts-directory}/${:_buildout_section_name_}
# You can override the collection like 'collection = aaa bbb ccc'
collection = all
command = ${buildout:bin-directory}/${nltk:interpreter} -m nltk.downloader -- -d ${:location} ${:collection}
diff -ur nltk-3.2.orig/nltk/data.py nltk-3.2/nltk/data.py
--- nltk-3.2.orig/nltk/data.py 2016-03-02 22:56:32.000000000 +0100
+++ nltk-3.2/nltk/data.py 2016-03-13 18:00:32.192142493 +0100
@@ -77,6 +77,9 @@
if 'APPENGINE_RUNTIME' not in os.environ and os.path.expanduser('~/') != '~/':
path.append(os.path.expanduser(str('~/nltk_data')))
+path += [os.path.join(os.path.dirname(os.path.abspath(__file__)),
+ '..', '..', '..', 'parts', 'nltk-data')]
+
if sys.platform.startswith('win'):
# Common locations on Windows:
path += [
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment