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

CLDR-16372 Code to replace lateral inheritance markers in trunk #3275

Merged
merged 2 commits into from
Sep 26, 2023

Conversation

btangmu
Copy link
Member

@btangmu btangmu commented Sep 20, 2023

-New CLDRModify -fZ, Zero lateral, replace INHERITANCE_MARKER with bailey for all lateral inheritance

-For -fZ new boolean CONSTRUCTED_PSEUDO_PATH_NOT_LATERAL in VoteResolver#reviseInheritanceAsNeeded, no change in behavior as it stands

-Revise CLDRModify -fV, values that would inherit laterally, do not crash if parentValue is null

-Comments

CLDR-16372

  • This PR completes the ticket.

ALLOW_MANY_COMMITS=true

-New CLDRModify -fZ, Zero lateral, replace INHERITANCE_MARKER with bailey for all lateral inheritance

-For -fZ new boolean CONSTRUCTED_PSEUDO_PATH_NOT_LATERAL in VoteResolver#reviseInheritanceAsNeeded, no change in behavior as it stands

-Revise CLDRModify -fV, values that would inherit laterally, do not crash if parentValue is null

-Comments
@btangmu btangmu self-assigned this Sep 20, 2023
@btangmu btangmu requested review from srl295 and macchiati September 21, 2023 15:06
@@ -2931,14 +2932,19 @@ public void handlePath(String xpath) {
parentFile = factory.make(parentId, true);
}
String parentValue = parentFile.getStringValueWithBailey(xpath);
if (!parentValue.equals(baileyValue)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

there was NPE for parentValue null here

String fullXPath = cldrFileToFilter.getFullXPath(xpath);
replace(fullXPath, fullXPath, newValue);
}
});
Copy link
Member Author

@btangmu btangmu Sep 21, 2023

Choose a reason for hiding this comment

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

This new "-fZ" results in more "hardening" than "-fV", mainly, I think, because "-fZ" doesn't distinguish between level one locales and other locales -- and also, because "-fZ" treats constructed values as lateral inheritance, while "-fV" doesn't

This PR re-enables -fV, and newly enables -fZ. One or the other may be useful for revising the production data, comparing the two is instructive.

(pathWhereFound.value.equals(path)
|| (CONSTRUCTED_PSEUDO_PATH_NOT_LATERAL
&& GlossonymConstructor.PSEUDO_PATH.equals(
pathWhereFound.value)))
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a change without a difference (in behavior). It paves the way for making -fZ (and vote resolution, etc., in general) a bit more similar to -fV by changing false to true

@@ -2876,11 +2877,11 @@ public void handleEnd() {

@Override
public void handleStart() {
// skip if the locale id's parent isn't root. That is, it must be at level-1
// locale.
// skip if the locale is root.
Copy link
Member Author

Choose a reason for hiding this comment

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

The comment wasn't accurate -- this just changes the comment to match the code

-New CLDRModify -fZ, Zero lateral, replace INHERITANCE_MARKER with bailey for all lateral inheritance

-For -fZ new boolean CONSTRUCTED_PSEUDO_PATH_NOT_LATERAL in VoteResolver#reviseInheritanceAsNeeded, no change in behavior as it stands

-Revise CLDRModify -fV, values that would inherit laterally, do not crash if parentValue is null

-Comments
@btangmu
Copy link
Member Author

btangmu commented Sep 26, 2023

@macchiati @srl295 this ticket is still "blocks-release" for v44, and the PR is a necessary step but doesn't finish the ticket. The finishing step will be to run either -fV or -fZ to "harden" about a quarter of a million values. So it will be great to have this PR reviewed for the code, and I'll follow up with one or more PRs for the data.

@btangmu btangmu merged commit c32f711 into unicode-org:main Sep 26, 2023
7 checks passed
@btangmu btangmu deleted the t16372_a branch September 26, 2023 18:09
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