-
Notifications
You must be signed in to change notification settings - Fork 107
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
Sentence count suggestion #22
Comments
I've got something similar in the code for readability-score that I've been meaning to move over. This looks pretty similar, I think. I was having all sorts of trouble with HTML pages where I was forcing block-level elements to end sentences, so ending up with multiple terminators over multiple lines, but they were all ending the same sentence. |
If you have a number of example sentences and such, I'd be quite willing to have a look at figuring out some smart regexes ;-) |
I've pushed the latest version of the text cleaning method, which handles sentences better. I don't have many good examples of tricky text, but will see if I can produce one from an HTML doc. The worst ones tend to end up with something like this, frequently (block elements replaced with periods, heading tend not to have sentence terminators):
After cleanup, that should look something like this:
|
In the inline code comments you already note:
// Will be tripped up by "Mr." or "U.K.". Not a major concern at this point.
I found it is also tripped up by
...
or?!
Just wanted to show you the below suggestion for consideration as it will at least provide better count in ... and ?! situations:
The text was updated successfully, but these errors were encountered: