Unexpected StopIteration exception being raised.

Đang mở
#325 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
42/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu tại pattern/text/init.py, ở _read(), load() và đường dẫn parser được hiển thị trong traceback. Tái hiện ví dụ trong README gọi tag(s), sau đó lần theo lý do _read() dẫn đến lỗi generator. Hoàn tất nghĩa là ví dụ chạy mà không có StopIteration hoặc RuntimeError và tạo ra đầu ra đã được phân tích cú pháp.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

I downloaded pattern module using pip. Then, when I try to run the example given in readme file, a StopIteration is being raised.
`
(ProjectIM) PS C:\Users\Sourav Kannantha B\Documents\ProjectIM\go bot> py .\pattern_ex.py
Traceback (most recent call last):
File "C:\Users\Sourav Kannantha B\Documents\ProjectIM\lib\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 "C:\Users\Sourav Kannantha B\Documents\ProjectIM\go bot\pattern_ex.py", line 11, in
v = tag(s)
File "C:\Users\Sourav Kannantha B\Documents\ProjectIM\lib\site-packages\pattern\text\en_init_.py", line 188, in tag
for sentence in parse(s, tokenize, True, False, False, False, encoding, **kwargs).split():
File "C:\Users\Sourav Kannantha B\Documents\ProjectIM\lib\site-packages\pattern\text\en_init_.py", line 169, in parse
return parser.parse(s, *args, **kwargs)
File "C:\Users\Sourav Kannantha B\Documents\ProjectIM\lib\site-packages\pattern\text_init_.py", line 1172, in parse
s[i] = self.find_tags(s[i], **kwargs)
File "C:\Users\Sourav Kannantha B\Documents\ProjectIM\lib\site-packages\pattern\text\en_init_.py", line 114, in find_tags
return Parser.find_tags(self, tokens, **kwargs)
File "C:\Users\Sourav Kannantha B\Documents\ProjectIM\lib\site-packages\pattern\text_init
.py", line 1113, in find_tags
lexicon = kwargs.get("lexicon", self.lexicon or {}),
File "C:\Users\Sourav Kannantha B\Documents\ProjectIM\lib\site-packages\pattern\text_init_.py", line 376, in len
return self.lazy("len")
File "C:\Users\Sourav Kannantha B\Documents\ProjectIM\lib\site-packages\pattern\text_init
.py", line 368, in lazy
self.load()
File "C:\Users\Sourav Kannantha B\Documents\ProjectIM\lib\site-packages\pattern\text_init
.py", line 625, in load
dict.update(self, (x.split(" ")[:2] for x in _read(self.path) if len(x.split(" ")) > 1))
File "C:\Users\Sourav Kannantha B\Documents\ProjectIM\lib\site-packages\pattern\text_init
.py", line 625, in
dict.update(self, (x.split(" ")[:2] for x in _read(self._path) if len(x.split(" ")) > 1))
RuntimeError: generator raised StopIteration
`

Ngôn ngữ chính
Python
Star
8.9k
Fork
1.6k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của clips/pattern

Tất cả issue của clips/pattern

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.