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
Proposal: Add Unicode properties to Unicode.Scalar #820
Proposal: Add Unicode properties to Unicode.Scalar #820
Conversation
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.
LGTM
public var isEmojiModifierBase: Bool { get } // UCHAR_EMOJI_MODIFIER_BASE | ||
|
||
public var isDefined: Bool { get } // u_isdefined | ||
public var hasNormalizationBoundaryBefore: Bool { get } // unorm2_hasBoundaryBefore |
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.
Either explicitly note that this is using the stdlib's preferred normalization form for comparisons, or include all forms, or remove.
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.
Good point. I'll remove it for now (and update my implementation PR soon); in the future we may want to provide more thorough wrappers around the normalizer APIs.
```swift | ||
extension Unicode.Scalar.Properties { | ||
|
||
public var isAlphabetic: Bool { get } // UCHAR_ALPHABETIC |
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.
For this proposal, probably better to list the UCD name rather than the ICU API. (I believe the implementation PR has already been adjusted).
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.
Done.
Hi Tony – I'm planning to kick off this review shortly, if you could take a quick look at Michael's comments first. Thanks! |
Sounds good—I should be able to make those changes in the next couple hours, if that's ok. |
The proposal has been updated; PTAL. |
This proposal corresponds to the discussion here, with a prototype implementation in this PR.