[Unicode]   Common Locale Data Repository : Bug Tracking Home | Site Map | Search

CLDR Ticket #9813(design datatest)

Opened 18 months ago

Last modified 5 weeks ago

In SupplementalDataInfo, enhance SampleList to provide info for mapping counts to examples

Reported by: pedberg Owned by: pedberg
Component: numbers Data Locale:
Phase: dvet Review:
Weeks: Data Xpath:



Follow-on to cldrbug 9348:

In SupplementalDataInfo, enhance SampleList with a method that can provide information for mapping counts to examples, which can be used to initialize PluralInfo's countToExampleSet - i.e. to do something better than trying to parse the String from SampleList.toString(), which is what PluralInfo is currently doing per cldrbug 9348:


Change History

comment:1 Changed 16 months ago by mark

  • Owner changed from anybody to mark
  • Priority changed from medium to minor
  • Status changed from new to accepted
  • Milestone changed from UNSCH to 31

comment:2 Changed 14 months ago by mark

  • Phase changed from rc to spec-beta

comment:3 Changed 13 months ago by mark

  • Milestone changed from 31 to 32

Agree that this should be done, but pushing to next release.

comment:4 Changed 6 months ago by mark

  • Owner changed from mark to pedberg

The SampleList already supplies API to get the sample ints and fractions.

int limit = sampleList.getRangeCount();
for (int i = 0; i < limit; ++i) {

int start = sampleList.getRangeStart(i);
int end = sampleList.getRangeEnd(i);
if (start == end) {


} else if (start + 1 == end) {

b.append(start).append(", ").append(end);
intCount += 2;

} else {

intCount += 2;





However, the SampleList is normally just built by extracting data from the plural rule source (plurals.xml and ordinals.xml).

The ultimate source of the examples are in GeneralPluralList.getExamples. That takes a thousand values and generates various combinations of those to come up with a (hopefully diverse and representative) set of integers and fractions that end up getting written out in plurals.xml and ordinals.xml.

So basically the rules source is a cache of interesting values that the other tools can use. It would be possible to refactor getExamples out into a separate class so that it could be called directly (probably with a cache), but that is more substantial work. So before undertaking that, it would be good for us to have a sense of the priority.

Passing back to you for discussion.

comment:5 Changed 6 months ago by pedberg

  • Phase changed from spec-beta to dvet
  • Status changed from accepted to design
  • Milestone changed from 32 to 33

comment:6 Changed 5 weeks ago by pedberg

  • Milestone changed from 33 to 34

Add a comment

Modify Ticket

as design

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.