titoBouzout / WordCount

Real-time Word, Char, Line and Page counter, in the status-bar for the document, line or selection. Sublime Text
Other
291 stars 50 forks source link

Incorrect counts when dashes are used #46

Closed andrewheiss closed 8 years ago

andrewheiss commented 9 years ago

The word count is decreased when dashes are used. Using all the default settings, here's what the plugin reports:

This is a test.
# Counted: 4 words; expected: 4 words

This is—a test.
# Counted: 2 words; expected 4 words; uses an em-dash (—)

This is–a test.
# Counted: 2 words; expected 4 words; uses an en-dash (–)

This is-a test.
# Counted: 2 words; expected 4 words; uses a regular dash (-)

It would almost make sense if the dash decreased the count by just one, since the is-a could possibly be treated as a single word, but the count removes the word unit completely—it seems to only count This and test.

andrewheiss commented 9 years ago

This seems to possibly be related to #16…

andrewheiss commented 9 years ago

This can cause some pretty large discrepancies for when word counts are important:

screen shot 2015-09-09 at 00 14 49

(Count of words in an actual document. Top program is Byword; bottom is Sublime Text.)

titoBouzout commented 8 years ago

Fixed thanks!