diff mbox

[04/11] gnu: Add python-nltk.

Message ID 20160822132018.19828-4-david@craven.ch
State New
Headers show

Commit Message

David Craven Aug. 22, 2016, 1:20 p.m. UTC
* gnu/packages/python.scm (python-nltk): New variable.
(python2-nltk): New variable.
---
 gnu/packages/python.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

Comments

Danny Milosavljevic Aug. 27, 2016, 8:39 a.m. UTC | #1
> +    (description "Natural Language Toolkit")

I'd elaborate on the description a bit. Otherwise LGTM.

From the site, buzzwords removed:

"It provides interfaces to over 50 corpora and lexical resources such as WordNet, along with a suite of text processing libraries for classification, tokenization, stemming, tagging, parsing, and semantic reasoning, wrappers for natural language processing libraries."
Leo Famulari Oct. 24, 2016, 9:15 p.m. UTC | #2
On Mon, Aug 22, 2016 at 03:20:11PM +0200, David Craven wrote:
> * gnu/packages/python.scm (python-nltk): New variable.
> (python2-nltk): New variable.

This is failing its test suite on core-updates:

https://hydra.gnu.org/build/1550846

Apparently it wants some extra data to run the tests:

  Resource 'corpora/gutenberg' not found.  Please use the NLTK
  Downloader to obtain the resource:  >>> nltk.download()
  Searched in:
    - '/homeless-shelter/nltk_data'
    - '/usr/share/nltk_data'
    - '/usr/local/share/nltk_data'
    - '/usr/lib/nltk_data'
    - '/usr/local/lib/nltk_data'
diff mbox

Patch

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index c184fd3..c1eaf12 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -10012,3 +10012,27 @@  binary or text.")
       (inputs
        `(("python2-enum34" ,python2-enum34)
          ,@(package-inputs base))))))
+
+(define-public python-nltk
+  (package
+    (name "python-nltk")
+    (version "3.2.1")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "nltk" version))
+              (sha256
+               (base32
+                "0skxbhnymwlspjkzga0f7x1hg3y50fwpfghs8g8k7fh6f4nknlym"))))
+    (build-system python-build-system)
+    (home-page "http://nltk.org/")
+    (synopsis "Natural Language Toolkit")
+    (description "Natural Language Toolkit")
+    (license license:asl2.0)
+    (properties `((python2-variant . ,(delay python2-nltk))))))
+
+(define-public python2-nltk
+  (let ((base (package-with-python2 (strip-python2-variant python-nltk))))
+    (package (inherit base)
+      (native-inputs
+       `(("python2-setuptools" ,python2-setuptools)
+         ,@(package-native-inputs base))))))