-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inaccurate word count on words with period (acronyms) or apostrophe #8078
Comments
I found a helpful regex that matches words with apostrophes: I'm wondering if it is possible to set custom regex in the word count. Is this possible? |
I did some research on this matter and all of the desktop editors count basically every character as a word - even if it's a single dot. Meanwhile, we limit the counted strings to only those containing letters or numbers. Is there any reason for that? Counting all of the strings as words would simplify the code, RegExp, and also the behavior of the word counter (all emails, acronyms, decimal fractions would be covered). |
I decided to keep some of the current behavior, so the plugin doesn't count the strings not containing letters or numbers - Google docs works the same way and it seems more reasonable than counting single dots or hyphens as words. |
Fix (word-count): The word count feature should consider a string with a special character as a single word. Closes #8078.
TBH I was surprised when I compared word count results across different text editors (Word 365, Pages, Google Docs, CKEditor). There are serious differences in obvious cases and it looks like there's no standard and each editor implements it in a different way.Β For instance, in Google Docs and Pages "U.S." is two words. In MS Word and CKEditor it is a single word, though (I assume this is correct). When I copied the content listed below into different editors the results were as follows:
|
π Provide detailed reproduction steps (if any)
βοΈ Expected result
β Actual result
π Other details
If you'd like to see this fixed sooner, add a π reaction to this post.
The text was updated successfully, but these errors were encountered: