Skip to content
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

Add sentences counting #26

Closed
brogol opened this issue Oct 17, 2014 · 1 comment
Closed

Add sentences counting #26

brogol opened this issue Oct 17, 2014 · 1 comment
Assignees

Comments

@brogol
Copy link

brogol commented Oct 17, 2014

Hello,

I needed to count sentences for my usage, I think it could be interesting for someones.
Here the code I've used, maybe not perfect but you get the spirit:

sentences: trimmed ? (trimmed.match(/[.?!…\n]+./g) || []).length + 1 : 0

@RadLikeWhoa RadLikeWhoa self-assigned this Oct 20, 2014
@RadLikeWhoa
Copy link
Owner

Added this as part of version 2.1.0 (https://github.com/RadLikeWhoa/Countable/releases/tag/v2.1.0). I decided not to split sentences at newlines, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants