Punctuation should demarcate word endings too.

This commit is contained in:
Azareal 2018-09-24 09:40:52 +10:00
parent cb9f067ff4
commit 00059194a5
1 changed files with 1 additions and 1 deletions

View File

@ -371,7 +371,7 @@ func WordCount(input string) (count int) {
}
var inSpace bool
for _, value := range input {
if unicode.IsSpace(value) {
if unicode.IsSpace(value) || unicode.IsPunct(value) {
if !inSpace {
inSpace = true
}