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

CLDR Ticket #6020(closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

Change "per" pattern

Reported by: mark Owned by: mark
Component: main Data Locale:
Phase: dsub Review: pedberg
Weeks: Data Xpath:
Xref:

ticket:5997

ticket:5955

Description (last modified by mark) (diff)

The 'per' pattern doesn't work for inflected languages, where the denominator changes. A possible solution:

Add the <unitPer> element, as in the following:

	<units>
		<unitLength type="long">
			<compoundUnit type="per">
				<compoundUnitPattern>{0} per {1}</compoundUnitPattern>
			</compoundUnit>
<!-- ADD -->
                        <unitPer type="duration-second">{0} per second</unitPer>
                        <unitPer type="duration-hour">{0} per hour</unitPer>
<!-- ADD -->
			<unit type="acceleration-g-force">
				<unitPattern count="one">{0} g-force</unitPattern>
				<unitPattern count="other">{0} g-force</unitPattern>
			</unit>

A difference from the <unit> type is that there is no count parameter; these are always singular.

We'd use this as follows.

When constructing numerator=N, denominator=D:

  1. format the numerator pattern with the number (eg "3 kilograms")
  2. See if there is a pattern for the denominator-per pattern (eg "{0} per-second").
  3. If so, then substitute the formatted numerator into the denominator pattern (eg "3 kilograms per second")
  4. If not, get the compoundUnit "per" pattern, and substitute the formatted numerator for {0} and the singular form of the denominator for {1} (eg {0} per {1} => "3 kilograms per second)

Denominators:

I would guess that the following would be the most immediately needed, but we need to check:

  • duration (hour, minute, second) probably the highest priority
  • length (m, cm, ft, in)
  • area (m2, ft2)
  • volume (m3, ft3)

NOTE:

It is a known limitation we don't support inflection of units in general. That is, we don't provide for cases where someone wants to construct a sentence like:

The city is at a distance 23 kilometers-of. (where I'm attaching the preposition to represent an inflection.)

The current goal for CLDR is to support styles like:

Distance: 23 kilometers per second

Attachments

Change History

comment:1 Changed 4 years ago by mark

  • Description modified (diff)

comment:2 Changed 4 years ago by mark

  • Description modified (diff)

comment:3 Changed 4 years ago by mark

Review this also with #5997 and decide what to do.

comment:4 Changed 4 years ago by emmons

  • Xref set to 5997 5955
  • Component changed from unknown to design
  • Milestone changed from UNSCH to 25dsub

comment:5 Changed 4 years ago by emmons

  • Owner changed from anybody to mark
  • Status changed from new to assigned

comment:6 Changed 4 years ago by mark

  • Description modified (diff)

Updated proposal.

comment:7 Changed 4 years ago by mark

  • Type changed from unknown to defect
  • Description modified (diff)

comment:8 Changed 3 years ago by emmons

  • Milestone changed from 25dsub to 25rc

Moving all 25dsub and 25design tickets to 25rc. If you plan to complete items in the 25M1 time frame, please move those tickets to 25M1.

comment:9 Changed 3 years ago by mark

Rather than the above, I suggest that we add them in the appropriate unit, eg:

<unit type="duration-second">

<unitPattern count="one">{0} second</unitPattern>
<unitPattern count="other">{0} seconds</unitPattern>
<unitPer>{0} per second</unitPer>

</unit>

That groups everything together, making it less likely that we'd have gratuitous differences. They should be also grouped together in the ST.

Last edited 3 years ago by mark (previous) (diff)

comment:10 Changed 3 years ago by mark

  • Component changed from design to data

Design accepted by committee Nov 13

comment:11 Changed 3 years ago by mark

  • Milestone changed from 25rc to 26dsub

comment:12 Changed 3 years ago by mark

  • Status changed from assigned to reviewing
  • Review set to pedberg

comment:13 Changed 3 years ago by mark

One item to add: if there is already a combined unit, use it first.

Example: {0} mph.

comment:14 Changed 3 years ago by mark

The name was changed to

<perUnitPattern>{0} per second</perUnitPattern>

comment:15 Changed 3 years ago by rocketman@…

<perUnit> -> <perUnitPattern>

comment:16 Changed 3 years ago by pedberg

  • Priority changed from assess to major
  • Status changed from reviewing to closed
  • Resolution set to fixed

These are in coverageLevels.xml too, must have been added under another ticket

comment:17 Changed 3 years ago by markus

  • Phase set to dsub
  • Milestone changed from 26dsub to 26
View

Add a comment

Modify Ticket

Action
as closed
Next status will be 'new'
Next status will be 'closed'
Author


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

 
Note: See TracTickets for help on using tickets.