-
Notifications
You must be signed in to change notification settings - Fork 14
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
match uppercase non-english letters too #45
Conversation
✅ Deploy Preview for sentence-splitter ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Can you add some test case?
https://github.com/textlint-rule/sentence-splitter#adding-snapshot-testcase
src/parser/AbbrMarker.ts
Outdated
@@ -7,7 +7,7 @@ const isCapitalized = (text: string) => { | |||
if (!text || text.length === 0) { | |||
return false; | |||
} | |||
return /^[A-Z]/.test(text); | |||
return /^\p{Lu}/u.test(text); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Node.js 10+ has supported Unicode character class escape: \p{...}, \P{...} - JavaScript | MDN.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to use /^\p{Uppercase_Letter}/
because I needed to find out what Lu meant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
#44