Open EmmaGerritse opened 4 years ago
This is one of the behaviors applied in python 3.7 and Pattern is based on 3.6. This is also discussed in #282 #283 and stackoverflow
This appears to be an easy workaround:
def pattern_stopiteration_workaround():
try:
print(lexeme('gave'))
except:
pass
def main():
pattern_stopiteration_workaround()
#Add your other code here
Basically, the pattern code will fail the first time you run it, so you first need to run it once and catch the Exception it throws.
It's worked well enough for my own scripts, but I don't know if it fixes every possible issue.
Ideally though, somebody should fork the clips/pattern project since it's no longer maintained.
When running the following code:
I get the following error:
However, if I run
conjugate("ben", PRESENT, 3, SG)
again in the same shell it works as expected.