>>> text8.dispersion_plot('social')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/supc/Py2.7Venv/local/lib/python2.7/site-packages/nltk/text.py", line 445, in dispersion_plot
dispersion_plot(self, words)
File "/home/supc/Py2.7Venv/local/lib/python2.7/site-packages/nltk/draw/dispersion.py", line 31, in dispersion_plot
words.reverse()
AttributeError: 'str' object has no attribute 'reverse'
however:
>>> dir(text8)
['_CONTEXT_RE', '_COPY_TOKENS', '__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__getitem__', '__hash__', '__init__', '__len__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__unicode__', '__weakref__', '_collocations', '_context', '_num', '_window_size', 'collocations', 'common_contexts', 'concordance', 'count', 'dispersion_plot', 'findall', 'index', 'name', 'plot', 'readability', 'similar', 'tokens', 'unicode_repr', 'vocab']
and
>>> text8.dispersion_plot
<bound method Text.dispersion_plot of <Text: Personals Corpus>>
Previously:
:~$ pip install --upgrade nltk
Downloading/unpacking nltk from
https://pypi.python.org/packages/source/n/nltk/nltk-3.0.1.tar.gz#md5=c4f4b7be66d19dd5faf3c8336bb4cec4 Downloading nltk-3.0.1.tar.gz (961kB): 961kB downloaded
Running setup.py (path:/home/supc/Py2.7Venv/build/nltk/setup.py) egg_info for package nltk
warning: no files found matching 'Makefile' under directory '*.txt'
warning: no previously-included files matching '*~' found anywhere in distribution
Installing collected packages: nltk
Found existing installation: nltk 2.0.4
Uninstalling nltk:
Successfully uninstalled nltk
Running setup.py install for nltk
warning: no files found matching 'Makefile' under directory '*.txt'
warning: no previously-included files matching '*~' found anywhere in distribution
Successfully installed nltk
Cleaning up...
Any help to remove these error messages would be appreciated. Thanks.