titoBouzout / WordCount

Real-time Word, Char, Line and Page counter, in the status-bar for the document, line or selection. Sublime Text

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect counts when dashes are used

andrewheiss opened this issue · comments

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.

This seems to possibly be related to #16

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.)

commented

Fixed thanks!