Open vizzerdrix55 opened 5 years ago
This is a strange coincidence I had the same problem today. See my post here, how to fix it :) https://github.com/clips/pattern/issues/282
Hello @DHOFM, I found out, that the Error only appears after the second time of processing a script. When I restart the kernel, there is no Error. I did the fixing you explained without success. I understood your approach of #282 like this:
Replace the following lines 608 and 609 of /anaconda3/lib/python3.7/site-packages/pattern/text/__init__.py
:
yield line
raise StopIteration
with
try:
yield line
except:
StopIteration
return
@vizzerdrix55 : Yes - that is what works for me, but I am not on Anaconda, I am on Mac OS but I do not think thats the difference. I use pattern3 for python3 so my path is .../lib/python3.7/site-packages/pattern3/text
What also is different in your code is you do not return only in an Exception so your code is:
except:
StopIteration
return
and my example is:
except StopIteration:
return
@DHOFM You are right. With the colon at the right place, the Error StopIteration doesn't appear anymore. Now I receive IndexError after the second time I run the script. I created a new Issue #284
Hello there I use pattern.de and installed in on Jupyter Notebook
I get the following error, when I try to run lemma-command in a for loop with massive (more than 10'000) tokens to be processed:
As there anything that I can do?
additional information: Python 3.7.1 (default, Dec 14 2018, 13:28:58) IPython 7.2.0
--- Logging error --- Traceback (most recent call last): File "/anaconda3/lib/python3.7/site-packages/pattern/text/init.py", line 609, in _read raise StopIteration StopIteration
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "", line 12, in getInfinitive
inf = lemma(verb_token)
File "/anaconda3/lib/python3.7/site-packages/pattern/text/init.py", line 2172, in lemma
self.load()
File "/anaconda3/lib/python3.7/site-packages/pattern/text/init.py", line 2127, in load
for v in _read(self._path):
RuntimeError: generator raised StopIteration