Bug report: Trailing spaces increase word count

23 views
Skip to first unread message

Peter T.

unread,
Jul 1, 2022, 7:39:16 AM7/1/22
to yWriter
On the NaNoWriMo forum, someone claimed that yWriter 7 was giving incorrect word counts. I looked into it and found out the following: 
With yWriter version 7.1.3.0, it looks as if a space at the end of a paragraph is counted as a separate word. 

This is a paragraph without a trailing space:

2words.png

This is a paragraph ending with a space:

3words.png


The same applies to scenes ending with a blank line. 


Simon Haynes

unread,
Jul 1, 2022, 8:21:29 AM7/1/22
to ywr...@googlegroups.com
Odd - I haven't touched the wordcount routine for many years, but perhaps I stopped the program stripping off trailing whitespace before doing the count.


--
You received this message because you are subscribed to the Google Groups "yWriter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ywriter+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ywriter/7cc07fd6-7970-41eb-90f2-ffa35eb19940n%40googlegroups.com.


--

--
Visit Spacejock Software, the home of yWriter, FCharts and more
Visit spacejock.com.au for my articles on writing and publishing novels.

Peter T.

unread,
Jul 1, 2022, 10:30:43 AM7/1/22
to yWriter
On Friday, July 1, 2022 at 2:21:29 PM UTC+2 Simon Haynes wrote:
 perhaps I stopped the program stripping off trailing whitespace before doing the count.

Yes, that would be an explanation.
In the meantime, further investigations have shown that dashes are apparently counted like ordinary letters. 
 
The "en-dash", as it is often used in Erurope, and surrounded by spaces, increases the word count.:

endash1.png

The "em-dash," as it is commonly used without spaces, joins two words into one when counting:

emdash1.png

This leads to very different counting errors with different language habits. 
I'll add that I put both dashes in the list of punctuation marks for the spell checker. 
 

Peter T.

unread,
Jul 1, 2022, 10:56:56 AM7/1/22
to yWriter
By the way, the screenshots show that hyphens do not join two words as they should, but separate them, so that one word too many is counted here as well.

A useful reference for word counting seems to be LibreOfiice 7. How NaNoWriMo does it, I cannot say.  
Reply all
Reply to author
Forward
0 new messages