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

Fix the IndexUnicodeProperties Joining_Type #657

Merged
merged 5 commits into from
Jan 20, 2024

Conversation

eggrobin
Copy link
Member

@eggrobin eggrobin commented Jan 18, 2024

Treat column 2 of ArabicShaping.txt as an unofficial contributory property and Joining_Type as a derived property in IndexUnicodePropertySource. When retiring ToolUnicodePropertySource, we should switch to using that derivation.

See the test failure prior to the fix.

@eggrobin eggrobin marked this pull request as ready for review January 18, 2024 10:09
@eggrobin eggrobin requested a review from macchiati January 18, 2024 10:15
Copy link
Member

@macchiati macchiati left a comment

Choose a reason for hiding this comment

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

clever approach. A few items:
The UcdProperty and UcdProperty values are generated by GenerateEnums, so that needs to be modified to produce the right values. Otherwise the next time it is run, the changes will be overridden.

Short term, I think making the derived property "occupy" field 1 is a clever hack. Longer term I think we need to add a better mechanism for derived IndexUnicodeProperties.

@eggrobin
Copy link
Member Author

The UcdProperty and UcdProperty values are generated by GenerateEnums, so that needs to be modified to produce the right values. Otherwise the next time it is run, the changes will be overridden.

I ran GenerateEnums already (a CI check tests that it does not change anything).

I think we need to add a better mechanism for derived IndexUnicodeProperties.

We have plenty of those in IndexUnicodeProperties.txt already, see e.g.

DerivedCoreProperties ; Lowercase
DerivedCoreProperties ; Uppercase
DerivedCoreProperties ; Cased
DerivedCoreProperties ; Case_Ignorable
DerivedCoreProperties ; Changes_When_Lowercased
DerivedCoreProperties ; Changes_When_Uppercased
DerivedCoreProperties ; Changes_When_Titlecased
DerivedCoreProperties ; Changes_When_Casefolded
DerivedCoreProperties ; Changes_When_Casemapped
DerivedCoreProperties ; Alphabetic
DerivedCoreProperties ; Default_Ignorable_Code_Point
DerivedCoreProperties ; Grapheme_Base
DerivedCoreProperties ; Grapheme_Extend
DerivedCoreProperties ; Grapheme_Link
DerivedCoreProperties ; Math
DerivedCoreProperties ; ID_Start
DerivedCoreProperties ; ID_Continue
DerivedCoreProperties ; XID_Start
DerivedCoreProperties ; XID_Continue
DerivedCoreProperties ; Indic_Conjunct_Break

@eggrobin
Copy link
Member Author

making the derived property "occupy" field 1 is a clever hack

You may have misread that line of IndexUnicodeProperties.txt, it is

DerivedJoiningType; Joining_Type; 1

that is, we are getting it from the derived file (like the other derived properties), where it actually does reside in field 1.

@macchiati
Copy link
Member

macchiati commented Jan 18, 2024 via email

@eggrobin eggrobin merged commit fdc9c95 into unicode-org:main Jan 20, 2024
15 checks passed
eggrobin added a commit to eggrobin/unicodetools that referenced this pull request Feb 2, 2024
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.

3 participants