antirez / antirez/smaz2

smaz2.py misses 0th word

Đang mở
#2 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C
Star
115
Fork
10
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

https://github.com/antirez/smaz2/blame/71ecc43e9f4f992a3d160494ab780e81efb743da/smaz2.py#L63

In smaz2.py I noticed:

Line 63 "If i:" will not take the "if" part if i == 0, which is i's 1st value from the enumerate. Thus the 1st word in the dictionary will not be matched.

Same issue occurs on lines 86 and 88 with respect to 0th bigram.

Suggest 4 changes:
1) in line 61 set i to None instead of False
2) in line 63 test "if i is not None:" instead of just "if i:"
3,4) repeat 1) and 2) for lines 86 + 88.

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

Đánh giá

Issue này chưa được đánh giá.

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.