Why does an en-dash count as a word? #2642
-
|
I'm posting some drabbles I wrote in nW to AO3 and just noticed that some of them AO3 says are less than 100 words. It took me a while to find the reason: nW counts my en-dashes (–) as words. I'm wondering what is the reason behind this and is there any other punctuation I should be on the lookout for that might skew the word count? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
|
En and em dashes are replaced with spaces before counting, so no, they are not counted as words. They do count as word separators though. I just double-checked this in the app, but the code that pre-processes the text before the word count is anyway clear: novelWriter/novelwriter/text/counting.py Lines 37 to 73 in 60d7bd3 |
Beta Was this translation helpful? Give feedback.

Ah, that clears it up. It is counting the closing quote as a word in this specific case.
The algorithm splits the text by (consecutive) white spaces and considers en and em dash as a white space in this context. Anything else is counted. If you have a "word" of pure punctuation, that too counts as a word.
For the record, LibreOffice Writer does the same thing. It was used as a reference for the word counter in novelWriter. Here are a few examples: