Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am trying to use the suggest function provided by pattern.en. But when i run the following script:

from pattern.en import suggest
corr = suggest("whitle") 

It gives the following error:

Traceback (most recent call last):
  File "C:UsersuserAppDataLocalProgramsPythonPython39libsite-packagespatternext\__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 "xxx", line 54, in <module>
    corr = suggest("whitle")
  File "C:UsersuserAppDataLocalProgramsPythonPython39libsite-packagespatternexten\__init__.py", line 207, in suggest
    return spelling.suggest(w)
  File "C:UsersuserAppDataLocalProgramsPythonPython39libsite-packagespatternext\__init__.py", line 2677, in suggest
    if len(self) == 0:
  File "C:UsersuserAppDataLocalProgramsPythonPython39libsite-packagespatternext\__init__.py", line 376, in __len__
    return self._lazy("__len__")
  File "C:UsersuserAppDataLocalProgramsPythonPython39libsite-packagespatternext\__init__.py", line 368, in _lazy
    self.load()
  File "C:UsersuserAppDataLocalProgramsPythonPython39libsite-packagespatternext\__init__.py", line 2621, in load
    for x in _read(self._path):
RuntimeError: generator raised StopIteration

I am completely new to generators and have no idea what this error means. Any help would mean alot. Thanks.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
140 views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...