Word count is off by one when text ends with a space
@accesswatch đang làm issue này rồi.
Từ ngày 8/11/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
What happened
word_count("hello world ") returns 3. There are only two words.
What I expected
- A space at the end of the text shouldn't count as a word.
How to see it
- Run
python -c "import sys; sys.path.insert(0, 'src'); import tally; print(tally.word_count('hello world '))" - It prints 3.
The same happens with two spaces between words.
- Ngôn ngữ chính
- Python
- Star
- 1
- Fork
- 0
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Community-Access/quill-github-practice
-
Count sentences as well as wordsĐang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
-
Question: what counts as a word?Đang mởquestion
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Community-Access/quill-github-practice#4 · 3 bình luận ·
-
documentation
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Add a line count to the summaryCó thể đã có người làm @github-actions đã nhận 20 ngày trước. Đang mởenhancement good first issue
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 20/100
Tất cả issue của Community-Access/quill-github-practice
Issue tương tự
-
request_access
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
-
blocker bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
achisolomon/software-factory#305 ·
-
free_port can hand one port to two callers, so the fixed-port http tests fail in parallel runsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 92/100
erkamyaman/rust-anything#963 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
commonmark/commonmark-spec#850 ·
-
Documentation websiteĐang mởdocumentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100