python Lookup Error


Could you help me to solve this error message? Code and error are attached.

thank you

text = "Punkt knows that the periods in Mr. Smith and Johann S. Bach do not mark sentence boundaries.  And sometimes sentences can start with non-capitalize words.  i is a good variable name."

tokenizer ='tokenizers/punkt/english.pickle')

print '\n-----\n'.join(tokenizer.tokenize(text.strip()))

Open in new window

$ python
Traceback (most recent call last):
  File "", line 5, in <module>
    tokenizer ='tokenizers/punkt/english.pickle')
  File "/usr/local/lib/python2.6/dist-packages/nltk-2.0b9-py2.6.egg/nltk/", line 594, in load
    resource_val = pickle.load(_open(resource_url))
  File "/usr/local/lib/python2.6/dist-packages/nltk-2.0b9-py2.6.egg/nltk/", line 673, in _open
    return find(path).open()
  File "/usr/local/lib/python2.6/dist-packages/nltk-2.0b9-py2.6.egg/nltk/", line 455, in find
    raise LookupError(resource_not_found)
  Resource 'tokenizers/punkt/english.pickle' not found.  Please
  use the NLTK Downloader to obtain the resource: >>>
  Searched in:
    - '/home/xralf/nltk_data'
    - '/usr/share/nltk_data'
    - '/usr/local/share/nltk_data'
    - '/usr/lib/nltk_data'
    - '/usr/local/lib/nltk_data'

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

As error says: Resource 'tokenizers/punkt/english.pickle' not found.

You need to place it in one of the listed dirs.
xRalfAuthor Commented:
I write'tokenizers/punkt/english.pickle')
it writes error
/usr/local/lib/python2.6/dist-packages/nltk-2.0b9-py2.6.egg/nltk/ DeprecationWarning: object.__new__() takes no parameters
[nltk_data] Error loading tokenizers/punkt/english.pickle: Package
[nltk_data]     'tokenizers/punkt/english.pickle' not found in index

Should I use it another way? I don't know how to get the missing things. That's why I ask.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
xRalfAuthor Commented:
thanks I found there similar discussion which showed me link to the files that were needed to download and I've done it rather manually.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.