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-14943 cldrsplain: refactor VoteResolver code, add API #2480

Merged
merged 1 commit into from
Oct 27, 2022

Conversation

srl295
Copy link
Member

@srl295 srl295 commented Oct 24, 2022

  • for now, include transcript with each row

CLDR-14943

  • This PR completes the ticket.

@srl295 srl295 requested a review from btangmu October 24, 2022 19:36
@srl295 srl295 self-assigned this Oct 24, 2022
@srl295 srl295 marked this pull request as ready for review October 24, 2022 19:46
@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • tools/cldr-apps/js/src/esm/cldrInfo.js is now changed in the branch
  • tools/cldr-apps/js/src/esm/cldrText.js is now changed in the branch

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

btangmu
btangmu previously approved these changes Oct 24, 2022
annotateTranscript("- This is the winning value because it comes earlier than '%s' when the text was sorted, though the weight was otherwise equal to the next-best.", nValue);
}
annotateTranscript("The Next-best (N) value is '%s', with weight %d", nValue, N);
}
Copy link
Member

Choose a reason for hiding this comment

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

minor quibble: better if subroutine is below its caller

Copy link
Member

Choose a reason for hiding this comment

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

in this case however it's intentionally adjacent to votesThenUcaCollator.compare

ideally the annotateTranscript calls might be inside votesThenUcaCollator.compare itself?

Copy link
Member Author

Choose a reason for hiding this comment

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

Right.
It can't be inside the collator because actually we don't annotate every comparison, just the top two.

Copy link
Member

Choose a reason for hiding this comment

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

the collator could call a method that has a boolean to turn on annotation; boolean false when the collator calls it, boolean true when this method calls it just for the top two

@@ -929,6 +929,10 @@ public void clear() {
oValue = null;
winningValue = null;
nValue = null;

if(transcript != null) {
Copy link
Member

Choose a reason for hiding this comment

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

minor minor quibble: java needs formatting

Copy link
Member Author

Choose a reason for hiding this comment

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

done

);
transcriptBox.appendChild(transcriptNote);
tr.voteDiv.appendChild(transcriptBox);
}
Copy link
Member

Choose a reason for hiding this comment

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

soon to be a vue component?

Copy link
Member Author

Choose a reason for hiding this comment

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

ideally

Copy link
Member Author

Choose a reason for hiding this comment

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

but as i mentioned this is a preview…  there may be ways to visualize the data better, however, i want to make sure i'm getting the right data first.

@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • tools/cldr-code/src/main/java/org/unicode/cldr/util/VoteResolver.java is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

- for now, include transcript with each row
- add in Info Panel
@jira-pull-request-webhook
Copy link