1

Where can I found the offline documentation for NLTK? It's not in usr/share/doc, where I mostly find docs of Python modules. And there is no nltk-doc package that can be installed.

2
  • What's your distribution and what sort of documentation are you expecting to be found? Just a README or something more expansive?
    – cwgem
    Mar 10, 2013 at 0:59
  • @cwgem: I'm using Ubuntu 12.04. I'd like to find an API for the module. The online version is the nltk.org/py-modindex.html, which includes an explanation and the source code.
    – xyz
    Mar 10, 2013 at 1:19

2 Answers 2

6

Okay so it definitely doesn't come with any package. However it can be built. So first:

sudo apt-get install python-epydoc

This is needed to build the documentation. Then I made this script to automate the build process for you:

#!/bin/bash

NLTK_VERSION=$(python -c 'import nltk; print nltk.__version__')
NLTK_URL=$(python -c 'import nltk; print nltk.__url__')
EPYDOC_OPTS = --name=nltk --navlink="nltk ${NLTK_VERSION}"\
              --url=${NLTK_URL} --inheritance=listed --debug

# Rebuild from scratch
[[ -e ~/python-nltk-docs ]] && rm -rf ~/python-nltk-docs

mkdir ~/python-nltk-docs
epydoc ${EPYDOC_OPTS} -o ~/python-nltk-docs /usr/share/pyshared/nltk

This will drop html docs into ~/python-nltk-docs for your viewing. I basically pulled this together from their doc Makefile.

2

Here is what I did, get the NLTK website code from their Github. This way I could do 'search' on the API documentation also.

https://github.com/nltk/nltk.github.com

Not the answer you're looking for? Browse other questions tagged or ask your own question.