I am on page 51 of the NLTK with Python Book but I am having trouble with some commands...
I am working on this on my Raspberry Pi 3 Jessie and don't know how to make the commands match my linux file system.
>>> from nltk.corpus import BracketParseCorpusReader
>>> corpus_root = r"/home/pi/nltk_data/corpora/penntreebank/parsed/mrg/wsj"
>>>
>>> file_pattern = r".*/wsj_.*\.mrg"
>>> ptb = BracketParseCorpusReader(corpus_root, file_pattern)
Traceback (most recent call last):
File "<pyshell#16>", line 1, in <module>
ptb = BracketParseCorpusReader(corpus_root, file_pattern)
File "/usr/local/lib/python2.7/dist-packages/nltk/corpus/reader/bracket_parse.py", line 49, in __init__
CorpusReader.__init__(self, root, fileids, encoding)
File "/usr/local/lib/python2.7/dist-packages/nltk/corpus/reader/api.py", line 84, in __init__
root = FileSystemPathPointer(root)
File "/usr/local/lib/python2.7/dist-packages/nltk/compat.py", line 221, in _decorator
return init_func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/nltk/data.py", line 303, in __init__
raise IOError('No such file or directory: %r' % _path)
IOError: No such file or directory: '/home/pi/nltk_data/corpora/penntreebank/parsed/mrg/wsj'
since I am not doing this in windows and don't have a C: drive the bold line was changed.