Bug 62799

Summary: Word count counts dashes as words - update Help for Word Count additional separators
Product: LibreOffice Reporter: Will Kemp <will>
Component: DocumentationAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: enhancement CC: olivier.hallot, rafael.palma.lima, will, xiscofauli
Priority: medium    
Version: Inherited From OOo   
Hardware: All   
OS: All   
URL: https://help.libreoffice.org/6.4/en-US/text/shared/optionen/01040900.html?System=WIN&DbPAR=WRITER&HID=modules/swriter/ui/optgeneralpage/OptGeneralPage#bm_id3150443
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=38983
https://bugs.documentfoundation.org/show_bug.cgi?id=126629
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 103479    
Attachments: There are 5 words here, but LibreOffice counts 6

Description Will Kemp 2013-03-27 08:59:38 UTC
Created attachment 77089 [details]
There are 5 words here, but LibreOffice counts 6

Word count gives the wrong result if there are any dashes ("-") in the text. It counts them as words if they're "independent" - i.e., not if they're joining two words.
Comment 1 Brenda Granados 2013-03-28 14:20:58 UTC
Hi, thank you for submitting a bug report. This bug is related to Bug 38983 : Word counts incorrectly with dashes and other separators. It seems that the algorithm LibreOffice uses to determine word count does so by seeing the spaces in between words. That's why 

There are five-words here
There are five- words here
There are five -words here

... all result in a word count of 5, but 

There are five - words here

... results in a word count of 6.

What you can do, as a user in the other bug report mentioned, is go to
Comment 2 Brenda Granados 2013-03-28 14:26:12 UTC
Sorry, I cut off my last comment. 

The workaround for the incorrect word count is go to Tools -> Options -> LibreOffice Writer -> General, and in the Word Count, additional separators box, add the "-" character.  After you click OK, and run the word count again, it counts 5 words.

Edit to my previous comment: word count on "There are five-words  here" is 4 words.

I will mark this as an enhancement request to have "-" character as default.


Version: 4.0.2.1 (Build ID: 7e5467ff8f30d821f4fbf69cb2769163eb64c2c)
Platform: Ubuntu Linux 12.04 LTS x64


- Brenda
Comment 3 Timur 2019-10-16 12:00:59 UTC
Repro 6.4+. Seems like an easy hack. 
Now in Options/Writer/Word Count: additional separators we have —– which is — and –. I don't know what it is, and it's not explained in Help, but doesn't work as a dash. If dash added, it's not counted.
Comment 4 Timur 2019-10-16 12:12:26 UTC
Those are emdash and endash and this all works as intended.
But instead of closing the bug, let's convert to Documentation so that help for Word Count explains that default additional separators are emdash and endash.
And what's nicely explained in https://bugs.documentfoundation.org/show_bug.cgi?id=38983#c15.
That can be related to https://help.libreoffice.org/Common/Inserting_Protected_Spaces,_Hyphens_and_Conditional_Separators and https://help.libreoffice.org/Common/Options_1.