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

Proposal: Add Unicode properties to Unicode.Scalar #820

Merged
merged 4 commits into from Apr 24, 2018

Conversation

allevato
Copy link
Collaborator

This proposal corresponds to the discussion here, with a prototype implementation in this PR.

Copy link
Contributor

@milseman milseman left a 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
Copy link
Contributor

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.

Copy link
Collaborator Author

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
Copy link
Contributor

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).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@airspeedswift
Copy link
Member

Hi Tony – I'm planning to kick off this review shortly, if you could take a quick look at Michael's comments first. Thanks!

@allevato
Copy link
Collaborator Author

Sounds good—I should be able to make those changes in the next couple hours, if that's ok.

@allevato
Copy link
Collaborator Author

The proposal has been updated; PTAL.

@airspeedswift airspeedswift merged commit 6df57d0 into apple:master Apr 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants