Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Installing NLTK
-
Ok so i finally got it to allow me to import and open the downloader. Do I need to do any config like set the download path or anything??
-
I have not changed any other settings.
-
It will not let be dowload brown. How did u guys do that and how did u guys run brown.words()
-
For example how can i set the NLTKDATA variable to the location of nltk_data
-
I think I used pythonista to open the data.py file and set it by hand. I think I added it as a path in the list on line 66. Don't know if that is the proper way to do it, but I figured I might have to get a bit hacky to make it work on an iPad.
-
Thats what I don't know though. Where am I setting it to? How do I find the path of nltk_data
-
My nltk_data directory is at the same level as Documents and NLTK works without setting the NLTKDATA variable.
-
Using the console I used
import os print os.path.expanduser('~/')
To get the path to the top level of my pythonista install. You can then add on whatever directories you have.
-
Playing with it some more I've found that it also wants Tkinter. Depending on which packages you load you might get a warning:
Documents/site-packages/nltk/draw/__init__.py:14: UserWarning: nltk.draw package not loaded (please install Tkinter library). warnings.warn("nltk.draw package not loaded "
So text#.dispersion_plot() won't work, but oddly FreqDist(text#).plot(#) does. Evidently plot uses Matplotlib, but dispersion_plot() uses Tkinter.
-
Spoke too soon. I changed line 456 in nltk.text.py to
from nltk.draw.dispersion import dispersion_plot
And now the dispersion_plot works. Not sure what in the draw package requires Tkinter, but that wasn't it.