From 00059194a5aeba7d1f1b584ee7cff0670a8c92f8 Mon Sep 17 00:00:00 2001 From: Azareal Date: Mon, 24 Sep 2018 09:40:52 +1000 Subject: [PATCH] Punctuation should demarcate word endings too. --- common/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/utils.go b/common/utils.go index e9f523dd..557a2c56 100644 --- a/common/utils.go +++ b/common/utils.go @@ -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 }