Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python's NLTK documentation [closed]

Tags:

python

nltk

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.

like image 810
xyz Avatar asked Jul 24 '26 21:07

xyz


2 Answers

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.

like image 173
cwgem Avatar answered Jul 26 '26 12:07

cwgem


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

like image 41
Frankie Fong Avatar answered Jul 26 '26 14:07

Frankie Fong



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!