diff --git a/docs/ldml/tr35-general.md b/docs/ldml/tr35-general.md index 5730f6546cb..3c958cf3ef2 100644 --- a/docs/ldml/tr35-general.md +++ b/docs/ldml/tr35-general.md @@ -909,12 +909,12 @@ Some of the constraints reference data from the unitIdComponents in [Unit_Conver - + - + - + - - + + - - + - + - + - + + + - + @@ -1033,7 +1037,7 @@ Some of the constraints reference data from the unitIdComponents in [Unit_Conver - +
unit_identifier:=
unit_identifier:= core_unit_identifier
| mixed_unit_identifier
| long_unit_identifier
core_unit_identifier:=
core_unit_identifier:= product_unit ("-" per "-" product_unit)*
| per "-" product_unit ("-" per "-" product_unit)*
  • Examples: @@ -930,16 +930,16 @@ Some of the constraints reference data from the unitIdComponents in [Unit_Conver
  • Constraint: The token 'per' is the single value in <unitIdComponent type="per">
product_unit:=
product_unit:= single_unit ("-" single_unit)* ("-" pu_single_unit)*
| pu_single_unit ("-" pu_single_unit)*
  • Example: foot-pound-force
  • Constraint: No pu_single_unit may precede a single unit
single_unit:=number_prefix? dimensionality_prefix? simple_unit -
  • Examples: square-meter, or 100-square-meter
single_unit:=dimensionality_prefix? simple_unit | unit_constant +
  • Examples: square-kilometer, or 100
pu_single_unit:= "xxx-" single_unit | "x-" single_unit @@ -948,17 +948,19 @@ Some of the constraints reference data from the unitIdComponents in [Unit_Conver
  • See Private-Use Units
  • number_prefix:=("1"[0-9]+ | [2-9][0-9]*) "-" +
    unit_constant:=("1"[0-9]+ | [2-9][0-9]*)("e" ("1"[0-9]+ | [2-9][0-9]*))?
    • Examples:
      • kilowatt-hour-per-100-kilometer
      • gallon-per-100-mile
      • per-200-pound
      • +
      • per-12
    • Note: The number is an integer greater than one.
    • +
    • Note: The e notation is optional: per-100-kilometer and per-1e2-kilometer are equivalent unit_identifiers.
    dimensionality_prefix:=
    dimensionality_prefix:= "square-"

    | "cubic-"

    | "pow" ([2-9]|1[0-5]) "-"

    • Constraint: must be value in: <unitIdComponent type="power">.
    • @@ -966,7 +968,7 @@ Some of the constraints reference data from the unitIdComponents in [Unit_Conver
    • Note: These are values in <unitIdComponent type="power">
    simple_unit:=
    simple_unit:= (prefix_component "-")* (prefixed_unit | base_component) ("-" suffix_component)*
    | currency_unit
    | "em" | "g" | "us" | "hg" | "of" @@ -979,16 +981,18 @@ Some of the constraints reference data from the unitIdComponents in [Unit_Conver
    prefixed_unit prefix base_component
    • Example: kilometer
    prefix
    prefix si_prefix | binary_prefix
    si_prefix:= "deka" | "hecto" | "kilo", … -
    binary_prefix:= "kibi", "mebi", … -
    prefix_component:= [a-z]{3,∞} @@ -1016,7 +1020,7 @@ Some of the constraints reference data from the unitIdComponents in [Unit_Conver
  • Constraint: must be value in: <unitIdComponent type="suffix">
  • mixed_unit_identifier:=
    := (single_unit | pu_single_unit) ("-" and "-" (single_unit | pu_single_unit ))*
    • Example: foot-and-inch
    grouping:= [a-z]{3,∞}
    currency_unit:=
    currency_unit:= "curr-" [a-z]{3}
    • Constraint: The first part of the currency_unit is a standard prefix; the second part of the currency unit must be a valid Unicode currency identifier.
    • @@ -1047,7 +1051,9 @@ Some of the constraints reference data from the unitIdComponents in [Unit_Conver
    -Note that while the syntax allows for number_prefixes in multiple places, the typical use case is only one instance, after a "-per-". +Note that while the syntax allows for unit_constants in multiple places, the typical use case is only one instance, after a "-per-". +The normalized form of a unit identifier has at most one unit_constant in the numerator and one in the denominator. +For example, `2-kilowatt-7-hour-per-3-meter-5-second` has the equivalent normalized form `14-kilowatt-hour-per-15-meter-second`. The simple_unit structure does not allow for any two simple_units to overlap. That is, there are no cases where simple_unit1 consists of X-Y and simple_unit2 consists of Y-Z. @@ -1322,12 +1328,12 @@ If there is no precomputed form, the following process in pseudocode is used to 2. set singlePluralCategory to be power0(singlePluralCategory) 3. set singleCaseVariant to be power0(singleCaseVariant) 4. remove the dimensionality_prefix from singleUnit - 4. if singleUnit starts with an si_prefix, such as 'centi' and/or a number_prefix such as '100' + 4. if singleUnit starts with an si_prefix, such as 'centi' and/or a unit_constant such as '100' 1. set siPrefixPattern to be getValue(that si_prefix, locale, length), such as "centy{0}" 2. set singlePluralCategory to be prefix0(singlePluralCategory) 3. set singleCaseVariant to be prefix0(singleCaseVariant) 4. remove the si_prefix from singleUnit - 5. set multiplier to be the locales integer numberFormat of number_prefix. + 5. set multiplier to be the locales integer numberFormat of unit_constant. 5. Set corePattern to be the getValue(singleUnit, locale, length, singlePluralCategory, singleCaseVariant), such as "{0} metrem" 6. Extract(corePattern, coreUnit, placeholder, placeholderPosition) from that pattern. 7. If the position is _middle_, then fail