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 simple and special case mapping #78

Merged

Conversation

JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Nov 3, 2024

In this PR we add Simple_Case_Mapping and Special_Casing to the package. The new data will enable regexpu-core to correctly generate the case mapping/folding data, especially for those new characters that are not yet covered by the latest runtime.

This PR should unblock mathiasbynens/regexpu-core#106.

To improve the package size, we enabled the compression for case folding data.

// conditions can contain a language ID defined by BCP 47 and casing contexts
// defined in Table 3-17 Context Specification for Casing
// https://www.unicode.org/versions/Unicode16.0.0/core-spec/chapter-3/#G54277
const conditions = data[4].replaceAll(" ", "--");
Copy link
Contributor Author

@JLHwung JLHwung Nov 3, 2024

Choose a reason for hiding this comment

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

Because the language ID may contain -, here we let -- be the separator between the language id and the casing contexts.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's make this an inline comment?

@mathiasbynens
Copy link
Collaborator

Thanks!

@mathiasbynens mathiasbynens merged commit c0a04ed into node-unicode:main Nov 4, 2024
1 check passed
@mathiasbynens
Copy link
Collaborator

Available in v1.6.1

@JLHwung
Copy link
Contributor Author

JLHwung commented Nov 4, 2024

The Simple_Case_Mapping is somehow missing from the published versions:

https://www.npmjs.com/package/@unicode/unicode-16.0.0?activeTab=code

@JLHwung JLHwung deleted the add-simple-and-special-case-mapping branch November 4, 2024 14:35
@mathiasbynens
Copy link
Collaborator

Simple_Case_Mapping

Hmm, it’s also missing from the generated output: https://github.com/node-unicode/unicode-16.0.0

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

Successfully merging this pull request may close these issues.

2 participants