Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nltk wordnet concurrency error WordNetError #2335

Closed
ndvbd opened this issue Jul 12, 2019 · 4 comments
Closed

nltk wordnet concurrency error WordNetError #2335

ndvbd opened this issue Jul 12, 2019 · 4 comments

Comments

@ndvbd
Copy link

ndvbd commented Jul 12, 2019

When running wordnet in multiple threads I get strange errors.
I am trying to get the synsets of a word.
Is Wordnet thread safe? Is there a way to solve it? If there is not immediate solution, where is the database of all words and their functions (verb/adjective/noun) stored?

The exceptions look like this:

raise WordNetError('line %r: %s' % (data_file_line, e))
  File "/usr/local/lib/python2.7/dist-packages/nltk/corpus/reader/wordnet.py", line 1342, in synset_from_pos_and_offs
et
    assert synset._offset == offset
*******************************************WordNetError: line u'02203362 40 v 03 have 0 have_got 0 hold 0 013 + 13244109 n 0303 + 10529202630189 42 v 02 have 0 feature 0 023 $ 02203362 v 0000 $ 02204692 v 0000 + 05601758 n 0201 + 05849789 n 0201 ! 02632353 v 0102 ~ 00047610 v 0000 ~ 00047745 v 0000 ~ 01123609 v 0000 ~ 02630734 v 0000 ~ 02630871 v 0000 ~ 02631005 v 0000 ~ 02631163 v 0000 ~ 02631349 v 0000 ~ 02631659 v 0000 ~ 02632167 v 0000 ~ 02636132 v 0000 ~ 02715456 v 0000 ~ 02715595 v 0000 ~ 02715812 v 0000 ~ 02717102 v 0000 ~ 02730813 v 0000 ~ 02740034 v 000at can only carry a small sail"  \n': need more than 1 value to unpack
AssertionError
@paulmattheww
Copy link

I have this same issue. I'll report back if I find a solution.

@cpcdoy
Copy link

cpcdoy commented Dec 24, 2019

Any solution to this issue?

@paulmattheww
Copy link

I gave up and just waited for it.

@stevenbird
Copy link
Member

Sorry this code is not threadsafe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants