xref: /aosp_15_r20/external/cldr/docs/ldml/tr35-general.md (revision 912701f9769bb47905792267661f0baf2b85bed5)
1## Unicode Technical Standard #35
2
3# Unicode Locale Data Markup Language (LDML)<br/>Part 2: General
4
5|Version|45                   |
6|-------|---------------------|
7|Editors|Yoshito Umaoka (<a href="mailto:[email protected]">[email protected]</a>) and <a href="tr35.md#Acknowledgments">other CLDR committee members|
8
9For the full header, summary, and status, see [Part 1: Core](tr35.md).
10
11### _Summary_
12
13This document describes parts of an XML format (_vocabulary_) for the exchange of structured locale data. This format is used in the [Unicode Common Locale Data Repository](https://www.unicode.org/cldr/).
14
15This is a partial document, describing general parts of the LDML: display names & transforms, etc. For the other parts of the LDML see the [main LDML document](tr35.md) and the links above.
16
17_Note:_
18Some links may lead to in-development or older
19versions of the data files.
20See <https://cldr.unicode.org> for up-to-date CLDR release data.
21
22### _Status_
23
24<!-- _This is a draft document which may be updated, replaced, or superseded by other documents at any time.
25Publication does not imply endorsement by the Unicode Consortium.
26This is not a stable document; it is inappropriate to cite this document as other than a work in progress._ -->
27
28_This document has been reviewed by Unicode members and other interested parties, and has been approved for publication by the Unicode Consortium.
29This is a stable document and may be used as reference material or cited as a normative reference by other specifications._
30
31> _**A Unicode Technical Standard (UTS)** is an independent specification. Conformance to the Unicode Standard does not imply conformance to any UTS._
32
33_Please submit corrigenda and other comments with the CLDR bug reporting form [[Bugs](tr35.md#Bugs)]. Related information that is useful in understanding this document is found in the [References](tr35.md#References). For the latest version of the Unicode Standard see [[Unicode](tr35.md#Unicode)]. For a list of current Unicode Technical Reports see [[Reports](tr35.md#Reports)]. For more information about versions of the Unicode Standard, see [[Versions](tr35.md#Versions)]._
34
35## <a name="Parts" href="#Parts">Parts</a>
36
37The LDML specification is divided into the following parts:
38
39*   Part 1: [Core](tr35.md#Contents) (languages, locales, basic structure)
40*   Part 2: [General](tr35-general.md#Contents) (display names & transforms, etc.)
41*   Part 3: [Numbers](tr35-numbers.md#Contents) (number & currency formatting)
42*   Part 4: [Dates](tr35-dates.md#Contents) (date, time, time zone formatting)
43*   Part 5: [Collation](tr35-collation.md#Contents) (sorting, searching, grouping)
44*   Part 6: [Supplemental](tr35-info.md#Contents) (supplemental data)
45*   Part 7: [Keyboards](tr35-keyboards.md#Contents) (keyboard mappings)
46*   Part 8: [Person Names](tr35-personNames.md#Contents) (person names)
47*   Part 9: [MessageFormat](tr35-messageFormat.md#Contents) (message format)
48
49## <a name="Contents" href="#Contents">Contents of Part 2, General</a>
50
51* [Display Name Elements](#Display_Name_Elements)
52  * [Locale Display Name Algorithm](#locale_display_name_algorithm)
53  * [Locale Display Name Fields](#locale_display_name_fields)
54* [Layout Elements](#Layout_Elements)
55* [Character Elements](#Character_Elements)
56  * [Exemplars](#Exemplars)
57    * [Exemplar Syntax](#ExemplarSyntax)
58    * [Restrictions](#Restrictions)
59  * ~~[Mapping](#Character_Mapping)~~
60  * ~~[Index Labels](#IndexLabels)~~
61  * [Ellipsis](#Ellipsis)
62  * [More Information](#Character_More_Info)
63  * [Parse Lenient](#Character_Parse_Lenient)
64* [Delimiter Elements](#Delimiter_Elements)
65  * [Tailoring Linebreak Using Delimiters](#Tailor_Linebreak_With_Delimiters)
66* [Measurement System Data](#Measurement_System_Data)
67  * [Measurement Elements (deprecated)](#Measurement_Elements)
68* [Unit Elements](#Unit_Elements)
69  * [Unit Preference and Conversion Data](#Unit_Preference_and_Conversion)
70  * [Unit Identifiers](#Unit_Identifiers)
71    * [Nomenclature](#nomenclature)
72    * [Syntax](#syntax)
73  * [Unit Identifier Uniqueness](#Unit_Identifier_Uniqueness)
74  * [Example Units](#Example_Units)
75  * [Compound Units](#compound-units)
76    * [Precomposed Compound Units](#precomposed-compound-units)
77  * [Unit Sequences (Mixed Units)](#Unit_Sequences)
78  * [durationUnit](#durationUnit)
79  * [coordinateUnit](#coordinateUnit)
80  * [Territory-Based Unit Preferences](#Territory_Based_Unit_Preferences)
81  * [Private-Use Units](#Private_Use_Units)
82* [POSIX Elements](#POSIX_Elements)
83* [Reference Element](#Reference_Elements)
84* [Segmentations](#Segmentations)
85  * [Segmentation Inheritance](#Segmentation_Inheritance)
86  * [Segmentation Suppressions](#Segmentation_Exceptions)
87* [Transforms](#Transforms)
88  * [Inheritance](#Inheritance)
89    * [Pivots](#Pivots)
90  * [Variants](#Variants)
91  * [Transform Rules Syntax](#Transform_Rules_Syntax)
92    * [Dual Rules](#Dual_Rules)
93    * [Context](#Context)
94    * [Revisiting](#Revisiting)
95    * [Example](#Example)
96    * [Rule Syntax](#Rule_Syntax)
97    * [Transform Rules](#Transform_Rules)
98    * [Variable Definition Rules](#Variable_Definition_Rules)
99    * [Filter Rules](#Filter_Rules)
100    * [Conversion Rules](#Conversion_Rules)
101    * [Intermixing Transform Rules and Conversion Rules](#Intermixing_Transform_Rules_and_Conversion_Rules)
102    * [Inverse Summary](#Inverse_Summary)
103  * [Transform Syntax Characters](#transform-syntax-characters)
104* [List Patterns](#ListPatterns)
105  * [Gender of Lists](#List_Gender)
106* [ContextTransform Elements](#Context_Transform_Elements)
107  * Table: [Element contextTransformUsage type attribute values](#contextTransformUsage_type_attribute_values)
108* [Choice Patterns](#Choice_Patterns)
109* [Annotations and Labels](#Annotations)
110  * [Synthesizing Sequence Names](#SynthesizingNames)
111    * [Table: Synthesized Emoji Sequence Names](#table-synthesized-emoji-sequence-names)
112  * [Annotations Character Labels](#Character_Labels)
113    * [Table: characterLabelPattern](#table-characterlabelpattern)
114    * [Table: characterLabel](#table-characterlabel)
115  * [Typographic Names](#Typographic_Names)
116* [Grammatical Features](#Grammatical_Features)
117* [Features](#features)
118  * [Gender](#Gender)
119    * [Example](#example)
120    * [Table: Values](#table-values)
121  * [Case](#Case)
122    * [Table: Case](#table-case)
123      * [Example](#example)
124        * [Table: Values](#table-values)
125  * [Definiteness](#definiteness)
126    * [Table: Values](#table-values)
127* [Grammatical Derivations](#Grammatical_Derivations)
128  * [Deriving the Gender of Compound Units](#gender_compound_units)
129  * [Deriving the Plural Category of Unit Components](#plural_compound_units)
130  * [Deriving the Case of Unit Components](#case_compound_units)
131
132## <a name="Display_Name_Elements" href="#Display_Name_Elements">Display Name Elements</a>
133
134```xml
135<!ELEMENT localeDisplayNames ( alias | ( localeDisplayPattern?, languages?, scripts?, territories?, subdivisions?, variants?, keys?, types?, transformNames?, measurementSystemNames?, codePatterns?, special* ) )>
136```
137
138Display names for scripts, languages, countries, currencies, and variants in this locale are supplied by this element. They supply localized names for these items for use in user-interfaces for various purposes such as displaying menu lists, displaying a language name in a dialog, and so on. Capitalization should follow the conventions used in the middle of running text; the `<contextTransforms>` element may be used to specify the appropriate capitalization for other contexts (see _[ContextTransform Elements](#Context_Transform_Elements)_). Examples are given below.
139
140> **Note:** The "en" locale may contain translated names for deprecated codes for debugging purposes. Translation of deprecated codes into other languages is discouraged.
141
142Where present, the display names must be unique; that is, two distinct codes would not get the same display name. (There is one exception to this: in time zones, where parsing results would give the same GMT offset, the standard and daylight display names can be the same across different time zone IDs.)
143
144Any translations should follow customary practice for the locale in question. For more information, see [[Data Formats](tr35.md#DataFormats)].
145
146```xml
147<localeDisplayPattern>
148```
149```xml
150<!ELEMENT localeDisplayPattern ( alias | (localePattern*, localeSeparator*, localeKeyTypePattern*, special*) ) >
151```
152
153For compound language (locale) IDs such as "pt_BR" which contain additional subtags beyond the initial language code: When the `<languages>` data does not explicitly specify a display name such as "Brazilian Portuguese" for a given compound language ID, "Portuguese (Brazil)" from the display names of the subtags.
154
155It includes three sub-elements:
156
157*   The `<localePattern>` element specifies a pattern such as "{0} ({1})" in which {0} is replaced by the display name for the primary language subtag and {1} is replaced by a list of the display names for the remaining subtags.
158*   The `<localeSeparator>` element specifies a pattern such as "{0}, {1}" used when appending a subtag display name to the list in the `<localePattern>` subpattern {1} above. If that list includes more than one display name, then `<localeSeparator>` subpattern {1} represents a new display name to be appended to the current list in {0}. _Note: Before CLDR 24, the `<localeSeparator>` element specified a separator string such as ", ", not a pattern._
159*   The `<localeKeyTypePattern>` element specifies the pattern used to display key-type pairs, such as "{0}: {1}"
160
161For example, for the locale identifier zh_Hant_CN_co_pinyin_cu_USD, the display would be "Chinese (Traditional, China, Pinyin Sort Order, Currency: USD)". The key-type for co_pinyin doesn't use the localeKeyTypePattern because there is a translation for the key-type in English:
162
163```xml
164<type type="pinyin" key="collation">Pinyin Sort Order</type>
165```
166
167### <a name="locale_display_name_algorithm" href="#locale_display_name_algorithm">Locale Display Name Algorithm</a>
168
169A locale display name LDN is generated for a locale identifier L in the following way. First, convert the locale identifier to *canonical syntax* per **[Part 1, Canonical Unicode Locale Identifiers](tr35.md#Canonical_Unicode_Locale_Identifiers)**. That will put the subtags in a defined order, and replace aliases by their canonical counterparts. (That defined order is followed in the processing below.)
170
171Then follow each of the following steps for the subtags in L, building a base name LDN and a list of qualifying strings LQS.
172
173Where there is a match for a subtag, disregard that subtag from L and add the element value to LDN or LQS as described below. If there is no match for a subtag, use the fallback pattern with the subtag instead.
174
175Once LDN and LQS are built, return the following based on the length of LQS.
176
177<!-- HTML: no header -->
178<table><tbody>
179<tr><td>0</td><td>return LDN</td></tr>
180<tr><td>1</td><td>use the &lt;localePattern&gt; to compose the result LDN from LDN and LQS[0], and return it.</td></tr>
181<tr><td>&gt;1</td><td>use the &lt;localeSeparator&gt; element value to join the elements of the list into LDN2, then use the &lt;localePattern&gt; to compose the result LDN from LDN and LDN2, and return it.</td></tr>
182</tbody></table>
183
184The processing can be controlled via the following parameters.
185
186*   `CombineLanguage`: boolean
187    *   Example: the `CombineLanguage = true`, picking the bold value below.
188    *   `<language type="nl">Dutch</language>`
189    *   **`<language type="nl_BE">Flemish</language>`**
190*   `PreferAlt`: map from element to preferred alt value, picking the bold value below.
191    *   Example: the `PreferAlt` contains `{"language"="short"}`:
192    *   `<language type="az">Azerbaijani</language>`
193    *   **`<language type="az" alt="short">Azeri</language>`**
194
195In addition, the input locale display name could be minimized (see [Part 1: Likely Subtags](tr35.md#Likely_Subtags)) before generating the LDN. Selective minimization is often the best choice. For example, in a menu list it is often clearer to show the region if there are any regional variants. Thus the user would just see \["Spanish"\] for es if the latter is the only supported Spanish, but where es-MX is also listed, then see \["Spanish (Spain)", "Spanish (Mexico)"\].
196
197* * *
198
199**Processing types of locale identifier subtags**
200
201When the display name contains "(" or ")" characters (or full-width equivalents), replace them by "\[", "\]" (or full-width equivalents) before adding.
202
2031.  **Language.** Match the L subtags against the type values in the `<language>` elements. Pick the element with the most subtags matching. If there is more than one such element, pick the one that has subtypes matching earlier. If there are two such elements, pick the one that is alphabetically less. If there is no match, then further convert L to *canonical form* per **[Part 1, Canonical Unicode Locale Identifiers](tr35.md#Canonical_Unicode_Locale_Identifiers)** and try the preceding steps again. Set LBN to the selected value. Disregard any of the matching subtags in the following processing.
204    *   If CombineLanguage is false, only choose matches with the language subtag matching.
2052.  **Script, Region, Variants.** Where any of these subtags are in L, append the matching element value to LQS.
2063.  **T extensions.** Get the value of the `key="h0" type="hybrid"` element, if there is one; otherwise the value of the `<key type="t">` element. Next get the locale display name of the tlang. Join the pair using `<localePattern>` and append to the LQS. Then format and add display names to LQS for any of the remaining tkey-tvalue pairs as described below.
2074.  **U extensions.** If there is an attribute value A, process the key-value pair <"u", A> as below and append to LQS. Then format and add display names for each of the remaining key-type pairs as described below.
2085.  **Other extensions.** There are currently no such extensions defined. Until such time as there are formats defined for them, append each of the extensions’ subtags to LQS.
2096.  **Private Use extensions.** Get the value
210
211**Formatting T/U Key-Value pairs as display names**
212
2131.  If there is a match for the key/value, then append the element value and return.
2142.  Otherwise, get the display name for the key, using the subtag if not available.
2153.  Format special values. As usual, if lacking data, use the subtag(s).
216    1.  key="kr": (REORDER_CODE) assume the value is a script code, and get its display name.
217    2.  key="dx": (SCRIPT_CODE) assume the value is a script code, and get its display name.
218    3.  key="vt": (CODEPOINTS, deprecated) the value is a list of code points. Set the value display name to it, after replacing \[-\_\] by space.
219    4.  key="x0": (PRIVATE_USE) the value is a list of subtags. No formatting available, so use the subtag(s).
220    5.  key="sd": (SUBDIVISION_CODE) use the subdivision data to find the display name.
221    6.  key="rg": (RG_KEY_VALUE): handle as with key="sd"
2224.  Then use the value of the `<localeKeyTypePattern>` element to join the key display name and the value display name, and append the result to LQS.
223
224**Examples of English locale display names**
225
226| Locale identifier             | Locale display name |
227| ----------------------------- | ------------------- |
228| es                            | Spanish |
229| es-419                        | Spanish (Latin America) |
230| es-Cyrl-MX                    | Spanish (Cyrillic, Mexico) |
231| en-Latn-GB-fonipa-scouse      | English (Latin, United Kingdom, IPA Phonetics, Scouse) |
232| en-u-nu-thai-ca-islamic-civil | English (Calendar: islamic-civil, Thai Digits) |
233| hi-u-nu-latn-t-en-h0-hybrid   | Hindi (Hybrid: English, Western Digits) |
234| en-u-nu-deva-t-de             | English (Transform: German, Devanagari Digits) |
235| fr-z-zz-zzz-v-vv-vvv-u-uu-uuu-t-ru-Cyrl-s-ss-sss-a-aa-aaa-x-u-x | French (Transform: Russian \[Cyrillic\], uu: uuu, a: aa-aaa, s: ss-sss, v: vv-vvv, x: u-x, z: zz-zzz) |
236
237
238
239### <a name="locale_display_name_fields" href="#locale_display_name_fields">Locale Display Name Fields</a>
240
241```xml
242<languages>
243```
244
245This contains a list of elements that provide the user-translated names for language codes, as described in _[Unicode Language and Locale Identifiers](tr35.md#Unicode_Language_and_Locale_Identifiers)_.
246
247```xml
248<language type="ab">Abkhazian</language>
249<language type="aa">Afar</language>
250<language type="af">Afrikaans</language>
251<language type="sq">Albanian</language>
252```
253
254There should be no expectation that the list of languages with translated names be complete: there are thousands of languages that could have translated names. For debugging purposes or comparison, when a language display name is missing, the Description field of the language subtag registry can be used to supply a fallback English user-readable name.
255
256The type can actually be any locale ID as specified above. The set of which locale IDs is not fixed, and depends on the locale. For example, in one language one could translate the following locale IDs, and in another, fall back on the normal composition.
257
258| type | translation | composition |
259| --- | --- | --- |
260| nl_BE | Flemish | Dutch (Belgium) |
261| zh_Hans | Simplified Chinese | Chinese (Simplified) |
262| en_GB | British English | English (United Kingdom) |
263
264Thus when a complete locale ID is formed by composition, the longest match in the language type is used, and the remaining fields (if any) added using composition.
265
266Alternate short forms may be provided for some languages (and for territories and other display names), for example.
267
268```xml
269<language type="az">Azerbaijani</language>
270<language type="az" alt="short">Azeri</language>
271<language type="en_GB">British English</language>
272<language type="en_GB" alt="short">U.K. English</language>
273<language type="en_US">American English</language>
274<language type="en_US" alt="short">U.S. English</language>
275```
276
277* * *
278
279```xml
280<scripts>
281```
282
283This element can contain a number of `script` elements. Each `script` element provides the localized name for a script code, as described in _[Unicode Language and Locale Identifiers](tr35.md#Unicode_Language_and_Locale_Identifiers)_ (see also _UAX #24: Script Names_ [[UAX24](https://www.unicode.org/reports/tr41/#UAX24)]). For example, in the language of this locale, the name for the Latin script might be "Romana", and for the Cyrillic script is "Kyrillica". That would be expressed with the following.
284
285```xml
286<script type="Latn">Romana</script>
287<script type="Cyrl">Kyrillica</script>
288```
289
290The script names are most commonly used in conjunction with a language name, using the `<localePattern>` combining pattern, and the default form of the script name should be suitable for such use. When a script name requires a different form for stand-alone use, this can be specified using the "stand-alone" alternate:
291
292```xml
293<script type="Hans">Simplified</script>
294<script type="Hans" alt="stand-alone">Simplified Han</script>
295<script type="Hant">Traditional</script>
296<script type="Hant" alt="stand-alone">Traditional Han</script>
297```
298
299This will produce results such as the following:
300
301* Display name of language + script, using `<localePattern>`: “Chinese (Simplified)”
302* Display name of script alone, using `<localePattern>`: “Simplified Han”
303
304* * *
305
306```xml
307<territories>
308```
309
310This contains a list of elements that provide the user-translated names for territory codes, as described in _[Unicode Language and Locale Identifiers](tr35.md#Unicode_Language_and_Locale_Identifiers)_.
311
312```xml
313<territory type="AD">Andorra</territory>
314<territory type="AF">Afghanistan</territory>
315<territory type="AL">Albania</territory>
316<territory type="AO">Angola</territory>
317<territory type="DZ">Algeria</territory>
318<territory type="GB">United Kingdom</territory>
319<territory type="GB" alt="short">U.K.</territory>
320<territory type="US">United States</territory>
321<territory type="US" alt="short">U.S.</territory>
322```
323
324Notes:
325* Territory names may not match the official name of the territory, and the English or French names may not match those in ISO 3166. Reasons for this include:
326    * CLDR favors customary names in common parlance, not necessarily the official names.
327    * CLDR endeavors to provide names that are not too long, in order to avoid problems with truncation or overflow in user interfaces.
328* In general the territory names should also match those used in currency names, see **Part 3** _[Currencies](tr35-numbers.md#Currencies)_.
329
330* * *
331
332```xml
333<variants>
334```
335
336This contains a list of elements that provide the user-translated names for the _variant_code_ values described in _[Unicode Language and Locale Identifiers](tr35.md#Unicode_Language_and_Locale_Identifiers)_.
337
338```xml
339<variant type="nynorsk">Nynorsk</variant>
340```
341
342* * *
343
344```xml
345<keys>
346```
347
348This contains a list of elements that provide the user-translated names for the _key_ values described in _[Unicode Language and Locale Identifiers](tr35.md#Unicode_Language_and_Locale_Identifiers)_.
349
350```xml
351<key type="collation">Sortierung</key>
352```
353
354Note that the `type` values may use aliases. Thus if the locale u-extension key "co" does not match, then the aliases have to be tried, using the bcp47 XML data:
355
356```xml
357<key name="co" description="…" alias="collation">
358```
359
360* * *
361
362```xml
363<types>
364```
365
366This contains a list of elements that provide the user-translated names for the _type_ values described in _[Unicode Language and Locale Identifiers](tr35.md#Unicode_Language_and_Locale_Identifiers)_. Since the translation of an option name may depend on the _key_ it is used with, the latter is optionally supplied.
367
368```xml
369<type type="phonebook" key="collation">Telefonbuch</type>
370```
371
372Note that the `key` and `type` values may use aliases. Thus if the locale u-extension key "co" does not match, then the aliases have to be tried, using the bcp47 XML data.
373
374```xml
375<key name="co" description="…" alias="collation">
376
377<type name="phonebk" description="…" alias="phonebook"/>
378```
379
380* * *
381
382```xml
383<measurementSystemNames>
384```
385
386This contains a list of elements that provide the user-translated names for systems of measurement. The types currently supported are "US", "metric", and "UK".
387
388```xml
389<measurementSystemName type="US">U.S.</type>
390```
391
392**Note:** In the future, we may need to add display names for the particular measurement units (millimeter versus millimetre versus whatever the Greek, Russian, etc are), and a message format for positioning those with respect to numbers. For example, "\{number} \{unitName}" in some languages, but "\{unitName} \{number}" in others.
393
394* * *
395
396```xml
397<transformNames>
398```
399
400```xml
401<transformName type="Numeric">Numeric</type>
402```
403
404* * *
405
406```xml
407<codePatterns>
408```
409
410```xml
411<codePattern type="language">Language: {0}</type>
412```
413
414* * *
415
416```xml
417<!ELEMENT subdivisions ( alias | ( subdivision | special )* ) >
418<!ELEMENT subdivision ( #PCDATA )>
419```
420
421Note that the subdivision names are in separate files, in the subdivisions/ directory. The type values are the fully qualified subdivision names. For example:
422
423```xml
424<subdivision type="AL-04">Fier County</subdivision>
425<subdivision type="AL-FR">Fier</subdivision> <!-- in AL-04 : Fier County -->
426<subdivision type="AL-LU">Lushnjë</subdivision> <!-- in AL-04 : Fier County -->
427<subdivision type="AL-MK">Mallakastër</subdivision> <!-- in AL-04 : Fier County -->
428```
429
430See also **Part 6** _[Subdivision Containment](tr35-info.md#Subdivision_Containment)_.
431
432## <a name="Layout_Elements" href="#Layout_Elements">Layout Elements</a>
433
434```xml
435<!ELEMENT layout ( alias | (orientation*, inList*, inText*, special*) ) >
436```
437
438This top-level element specifies general layout features. It currently only has one possible element (other than `<special>`, which is always permitted).
439
440```xml
441<!ELEMENT orientation ( characterOrder*, lineOrder*, special* ) >
442<!ELEMENT characterOrder ( #PCDATA ) >
443<!ELEMENT lineOrder ( #PCDATA ) >
444```
445
446The `lineOrder` and `characterOrder` elements specify the default general ordering of lines within a page, and characters within a line. The possible values are:
447
448<!-- HTML: rowspan -->
449<table><tbody>
450<tr><th>Direction</th><th>Value</th></tr>
451<tr><td rowspan="2">Vertical</td><td>top-to-bottom</td></tr>
452<tr>                             <td>bottom-to-top</td></tr>
453<tr><td rowspan="2">Horizontal</td><td>left-to-right</td></tr>
454<tr>                               <td>right-to-left</td></tr>
455</tbody></table>
456
457If the value of lineOrder is one of the vertical values, then the value of characterOrder must be one of the horizontal values, and vice versa. For example, for English the lines are top-to-bottom, and the characters are left-to-right. For Mongolian (in the Mongolian Script) the lines are right-to-left, and the characters are top to bottom. This does not override the ordering behavior of bidirectional text; it does, however, supply the paragraph direction for that text (for more information, see _UAX #9: The Bidirectional Algorithm_ [[UAX9](https://www.unicode.org/reports/tr41/#UAX9)]).
458
459For dates, times, and other data to appear in the right order, the display for them should be set to the orientation of the locale.
460
461* * *
462
463```xml
464<inList> (deprecated)
465```
466
467The `<inList>` element is deprecated and has been superseded by the `<contextTransforms>` element; see _[ContextTransform Elements](#Context_Transform_Elements)_.
468
469This element controls whether display names (language, territory, etc) are title cased in GUI menu lists and the like. It is only used in languages where the normal display is lower case, but title case is used in lists. There are two options:
470
471```xml
472<inList casing="titlecase-words">
473
474<inList casing="titlecase-firstword">
475```
476
477In both cases, the title case operation is the default title case function defined by Chapter 3 of _[[Unicode](tr35.md#Unicode)]_. In the second case, only the first word (using the word boundaries for that locale) will be title cased. The results can be fine-tuned by using alt="list" on any element where titlecasing as defined by the Unicode Standard will produce the wrong value. For example, suppose that "turc de Crimée" is a value, and the title case should be "Turc de Crimée". Then that can be expressed using the alt="list" value.
478
479* * *
480
481```xml
482<inText> (deprecated)
483```
484
485The `<inList>` element is deprecated and has been superseded by the `<contextTransforms>` element; see _[ContextTransform Elements](#Context_Transform_Elements)_.
486
487This element indicates the casing of the data in the category identified by the `inText` `type` attribute, when that data is written in text or how it would appear in a dictionary. For example:
488
489```xml
490<inText type="languages">lowercase-words</inText>
491```
492
493indicates that language names embedded in text are normally written in lower case. The possible values and their meanings are :
494
495*   titlecase-words : all words in the phrase should be title case
496*   titlecase-firstword : the first word should be title case
497*   lowercase-words : all words in the phrase should be lower case
498*   mixed : a mixture of upper and lower case is permitted, generally used when the correct value is unknown
499
500## <a name="Character_Elements" href="#Character_Elements">Character Elements</a>
501
502```xml
503<!ELEMENT characters ( alias | ( exemplarCharacters*, ellipsis*, moreInformation*, stopwords*, indexLabels*, mapping*, parseLenients*, special* ) ) >
504```
505
506The `<characters>` element provides optional information about characters that are in common use in the locale, and information that can be helpful in picking resources or data appropriate for the locale, such as when choosing among character encodings that are typically used to transmit data in the language of the locale. It may also be used to help reduce confusability issues: see [[UTR39](https://www.unicode.org/reports/tr41/#UTR36)]. It typically only occurs in a language locale, not in a language/territory locale. The stopwords are an experimental feature, and should not be used.
507
508### <a name="Exemplars" href="#Exemplars">Exemplars</a>
509
510Exemplars are characters used by a language, separated into different categories. The following table provides a summary, with more details below.
511
512| Type            | Description | Examples |
513| --------------- | ----------- | -------- |
514| main / standard | Main letters used in the language | a-z å æ ø |
515| auxiliary       | Additional characters for common foreign words, technical usage | á à ă â å ä ã ā æ ç é è ĕ ê ë ē í ì ĭ î ï ī ñ ó ò ŏ ô ö ø ō œ ú ù ŭ û ü ū ÿ |
516| index           | Characters for the header of an index | A B C D E F G H I J K L M N O P Q R S T U V W X Y Z |
517| punctuation     | Common punctuation | - ‐ – — , ; \\: ! ? . … “ ” ‘ ’ ( ) [ ] § @ * / & # † ‡ ′ ″ |
518| numbers         | The characters needed to display the common number formats: decimal, percent, and currency. | \[\\u061C\\u200E \\- , ٫ ٬ . % ٪ ‰ ؉ + 0٠ 1١ 2٢ 3٣ 4٤ 5٥ 6٦ 7٧ 8٨ 9٩\] |
519
520The basic exemplar character sets (main and auxiliary) contain the commonly used letters for a given modern form of a language, which can be for testing and for determining the appropriate repertoire of letters for charset conversion or collation. ("Letter" is interpreted broadly, as anything having the property Alphabetic in the [[UAX44](https://www.unicode.org/reports/tr41/#UAX44)], which also includes syllabaries and ideographs.) It is not a complete set of letters used for a language, nor should it be considered to apply to multiple languages in a particular country. Punctuation and other symbols should not be included in the main and auxiliary sets. In particular, format characters like CGJ are not included.
521
522There are five sets altogether: main, auxiliary, punctuation, numbers, and index. The _main_ set should contain the minimal set required for users of the language, while the _auxiliary_ exemplar set is designed to encompass additional characters: those non-native or historical characters that would customarily occur in common publications, dictionaries, and so on. Major style guidelines are good references for the auxiliary set. So, for example, if Irish newspapers and magazines would commonly have Danish names using å, for example, then it would be appropriate to include å in the auxiliary exemplar characters; just not in the main exemplar set. Thus English has the following:
523
524```xml
525<exemplarCharacters>[a b c d e f g h i j k l m n o p q r s t u v w x y z]</exemplarCharacters>
526<exemplarCharacters type="auxiliary">[á à ă â å ä ã ā æ ç é è ĕ ê ë ē í ì ĭ î ï ī ñ ó ò ŏ ô ö ø ō œ ú ù ŭ û ü ū ÿ]</exemplarCharacters>
527```
528
529For a given language, there are a few factors that help for determining whether a character belongs in the auxiliary set, instead of the main set:
530
531*   The character is not available on all normal keyboards.
532*   It is acceptable to always use spellings that avoid that character.
533
534For example, the exemplar character set for en (English) is the set \[a-z\]. This set does not contain the accented letters that are sometimes seen in words like "résumé" or "naïve", because it is acceptable in common practice to spell those words without the accents. The exemplar character set for fr (French), on the other hand, must contain those characters: \[a-z é è ù ç à â ê î ô û æ œ ë ï ÿ\]. The main set typically includes those letters commonly "alphabet".
535
536The _punctuation_ set consists of common punctuation characters that are used with the language (corresponding to main and auxiliary). Symbols may also be included where they are common in plain text, such as ©. It does not include characters with narrow technical usage, such as dictionary punctuation/symbols or copy-edit symbols. For example, English would have something like the following:
537
538> - ‐ – —
539> , ; : ! ? . …
540> ' ‘ ’ " “ ” ′ ″
541> ( ) [ \] { } ⟨ ⟩
542> © ® ™ @ & ° ‧ ·/ # % ¶ § * † ‡
543> + − ± × ÷ < ≤ = ≅ ≥ > √
544
545The numbers exemplars do not currently include lesser-used characters: exponential notation (3.1 × 10²³, ∞, NaN). Nor does it contain the units or currency symbols such as $, ¥, ₹, … It does contain %, because that occurs in the percent format. It may contain some special formatting characters like the RLM. A full list of the currency symbols used with that locale are in the `<currencies>` element, while the units can be gotten from the `<units>` element (both using inheritance, of course).The digits used in each numbering system are accessed in numberingSystems.xml. For more information, see _**Part 3: [Numbers](tr35-numbers.md#Contents)**, [Number Elements](tr35-numbers.md#Number_Elements)_.
546
547_Examples for zh.xml:_
548
549| Type                              | Description |
550| --------------------------------- | ----------- |
551| defaultNumberingSystem            | latn        |
552| otherNumberingSystems/native      | hanidec     |
553| otherNumberingSystems/traditional | hans        |
554| otherNumberingSystems/finance     | hansfin     |
555
556When determining the character repertoire needed to support a language, a reasonable initial set would include at least the characters in the main and punctuation exemplar sets, along with the digits and common symbols associated with the numberSystems supported for the locale (see _[Numbering Systems](tr35-numbers.md#Numbering_Systems)_).
557
558The _index_ characters are a set of characters for use as a UI "index", that is, a list of clickable characters (or character sequences) that allow the user to see a segment of a larger "target" list. For details see the [Unicode LDML: Collation](tr35-collation.md#Collation_Indexes) document. The index set may only contain characters whose lowercase versions are in the main and auxiliary exemplar sets, though for cased languages the index exemplars are typically in uppercase. Characters from the auxiliary exemplar set may be necessary in the index set if it needs to properly handle items such as names which may require characters not included in the main exemplar set.
559
560Here is a sample of the XML structure:
561
562```xml
563<exemplarCharacters type="index">[A B C D E F G H I J K L M N O P Q R S T U V W X Y Z]</exemplarCharacters>
564```
565
566The display of the index characters can be modified with the `indexLabel`s elements, discussed in Section 3.3.
567
568#### <a name="ExemplarSyntax" href="#ExemplarSyntax">Exemplar Syntax</a>
569
570In all of the exemplar characters, the list of characters is in the [Unicode Set](tr35.md#Unicode_Sets) format, which normally allows boolean combinations of sets of letters and Unicode properties.
571
572Sequences of characters that act like a single letter in the language — especially in collation — are included within braces, such as `[a-z á é í ó ú ö ü ő ű {cs} {dz} {dzs} {gy} ...]`. The characters should be in normalized form (NFC). Where combining marks are used generatively, and apply to a large number of base characters (such as in Indic scripts), the individual combining marks should be included. Where they are used with only a few base characters, the specific combinations should be included. Wherever there is not a precomposed character (for example, single codepoint) for a given combination, that must be included within braces. For example, to include sequences from the [Where is my Character?](https://www.unicode.org/standard/where/) page on the Unicode site, one would write: `[{ch} {tʰ} {x̣} {ƛ̓} {ą́} {i̇́} {ト゚}]`, but for French one would just write `[a-z é è ù ...]`. When in doubt use braces, since it does no harm to include them around single code points: for example, `[a-z {é} {è} {ù} ...]`.
573
574If the letter 'z' were only ever used in the combination 'tz', then we might have `[a-y {tz}]` in the main set. (The language would probably have plain 'z' in the auxiliary set, for use in foreign words.) If combining characters can be used productively in combination with a large number of others (such as say Indic matras), then they are not listed in all the possible combinations, but separately, such as:
575
576```
577[ॐ ऄ-ऋ ॠ ऌ ॡ ऍ-क क़ ख ख़ ग ग़ घ-ज ज़ झ-ड ड़ ढ ढ़ ण-फ फ़ ब-य य़ र-ह ़ ँ-ः ॑-॔ ऽ ् ॽ ा-ॄ ॢ ॣ ॅ-ौ]
578```
579
580The exemplar character set for Han characters is composed somewhat differently. It is even harder to draw a clear line for Han characters, since usage is more like a frequency curve that slowly trails off to the right in terms of decreasing frequency. So for this case, the exemplar characters simply contain a set of reasonably frequent characters for the language.
581
582The ordering of the characters in the set is irrelevant, but for readability in the XML file the characters should be in sorted order according to the locale's conventions. The main and auxiliary sets should only contain lower case characters (except for the special case of Turkish and similar languages, where the dotted capital I should be included); the upper case letters are to be mechanically added when the set is used. For more information on casing, see the discussion of Special Casing in the Unicode Character Database.
583
584#### <a name="Restrictions" href="#Restrictions">Restrictions</a>
585
5861.  The main, auxiliary and index sets are normally restricted to those letters with a specific [Script](https://www.unicode.org/Public/UNIDATA/Scripts.txt) character property (that is, not the values Common or Inherited) or required [Default_Ignorable_Code_Point](https://www.unicode.org/Public/UNIDATA/DerivedCoreProperties.txt) characters (such as a non-joiner), or combining marks, or the [Word_Break](https://www.unicode.org/Public/UNIDATA/auxiliary/WordBreakProperty.txt) properties [Katakana](https://www.unicode.org/reports/tr29/#Katakana), [ALetter](https://www.unicode.org/reports/tr29/#ALetter), or [MidLetter](https://www.unicode.org/reports/tr29/#MidLetter).
5872.  The auxiliary set should not overlap with the main set. There is one exception to this: Hangul Syllables and CJK Ideographs can overlap between the sets.
5883.  Any [Default_Ignorable_Code_Point](https://www.unicode.org/Public/UNIDATA/DerivedCoreProperties.txt)s should be in the auxiliary set, or, if they are only needed for currency formatting, in the currency set. These can include characters such as U+200E LEFT-TO-RIGHT MARK and U+200F RIGHT-TO-LEFT MARK which may be needed in bidirectional text in order for date, currency or other formats to display correctly.
5894.  For exemplar characters the [Unicode Set](tr35.md#Unicode_Sets) format is restricted so as to not use properties or boolean combinations.
590
591### ~~<a name="Character_Mapping" href="#Character_Mapping">Mapping</a>~~
592
593**This element has been deprecated.** For information on its structure and how it was intended to specify locale-specific preferred encodings for various purposes (e-mail, web), see the [Mapping](https://www.unicode.org/reports/tr35/tr35-39/tr35-general.html#Character_Mapping) section from the CLDR 27 version of the LDML Specification.
594
595### ~~<a name="IndexLabels" href="#IndexLabels">Index Labels</a>~~
596
597**This element and its subelements have been deprecated.** For information on its structure and how it was intended to provide data for a compressed display of index exemplar characters where space is limited, see the [Index Labels](https://www.unicode.org/reports/tr35/tr35-39/tr35-general.html#IndexLabels) section from the CLDR 27 version of the LDML Specification.
598
599```xml
600<!ELEMENT indexLabels (indexSeparator*, compressedIndexSeparator*, indexRangePattern*, indexLabelBefore*, indexLabelAfter*, indexLabel*) >
601```
602
603### <a name="Ellipsis" href="#Ellipsis">Ellipsis</a>
604
605```xml
606<!ELEMENT ellipsis ( #PCDATA ) >
607<!ATTLIST ellipsis type ( initial | medial | final | word-initial | word-medial | word-final ) #IMPLIED >
608```
609
610The `ellipsis` element provides patterns for use when truncating strings. There are three versions: initial for removing an initial part of the string (leaving final characters); medial for removing from the center of the string (leaving initial and final characters), and final for removing a final part of the string (leaving initial characters). For example, the following uses the ellipsis character in all three cases (although some languages may have different characters for different positions).
611
612```xml
613<ellipsis type="initial">…{0}</ellipsis>
614<ellipsis type="medial">{0}…{1}</ellipsis>
615<ellipsis type="final">{0}…</ellipsis>
616```
617
618There are alternatives for cases where the breaks are on a word boundary, where some languages include a space. For example, such a case would be:
619
620```xml
621<ellipsis type="word-initial">… {0}</ellipsis>
622```
623
624### <a name="Character_More_Info" href="#Character_More_Info">More Information</a>
625
626The moreInformation string is one that can be displayed in an interface to indicate that more information is available. For example:
627
628```xml
629<moreInformation>?</moreInformation>
630```
631
632### <a name="Character_Parse_Lenient" href="#Character_Parse_Lenient">Parse Lenient</a>
633
634```xml
635<!ELEMENT parseLenients ( alias | ( parseLenient*, special* ) ) >
636<!ATTLIST parseLenients scope (general | number | date) #REQUIRED >
637<!ATTLIST parseLenients level (lenient | stricter) #REQUIRED >
638
639<!ELEMENT parseLenient ( #PCDATA ) >
640<!ATTLIST parseLenient sample CDATA #REQUIRED >
641<!ATTLIST parseLenient alt NMTOKENS #IMPLIED >
642<!ATTLIST parseLenient draft (approved | contributed | provisional | unconfirmed) #IMPLIED >
643```
644
645Example:
646
647```xml
648<parseLenients scope="date" level="lenient">
649    <parseLenient sample="-">[\-./]</parseLenient>
650    <parseLenient sample=":">[\:∶]</parseLenient>
651</parseLenients>
652```
653
654The `parseLenient` elements are used to indicate that characters within a particular UnicodeSet are normally to be treated as equivalent when doing a lenient parse. The `scope` attribute value defines where the lenient sets are intended for use. The `level` attribute value is included for future expansion; currently the only value is "lenient".
655
656The `sample` attribute value is a paradigm element of that UnicodeSet, but the only reason for pulling it out separately is so that different classes of characters are separated, and to enable inheritance overriding. The first version of this data is populated with the data used for lenient parsing from ICU.
657
658## <a name="Delimiter_Elements" href="#Delimiter_Elements">Delimiter Elements</a>
659
660```xml
661<!ELEMENT delimiters (alias | (quotationStart*, quotationEnd*, alternateQuotationStart*, alternateQuotationEnd*, special*)) >
662```
663
664The delimiters supply common delimiters for bracketing quotations. The quotation marks are used with simple quoted text, such as:
665
666> He said, “Don’t be absurd!”
667
668When quotations are nested, the quotation marks and alternate marks are used in an alternating fashion:
669
670> He said, “Remember what the Mad Hatter said: ‘Not the same thing a bit! Why you might just as well say that “I see what I eat” is the same thing as “I eat what I see”!’”
671
672```xml
673<quotationStart>“</quotationStart>
674<quotationEnd>”</quotationEnd>
675<alternateQuotationStart>‘</alternateQuotationStart>
676<alternateQuotationEnd>’</alternateQuotationEnd>
677```
678
679### <a name="Tailor_Linebreak_With_Delimiters" href="#Tailor_Linebreak_With_Delimiters">Tailoring Linebreak Using Delimiters</a>
680
681The delimiter data can be used for language-specific tailoring of linebreak behavior, as suggested
682in the [description of linebreak class QU: Quotation](https://www.unicode.org/reports/tr14/#QU)
683in [[UAX14](https://www.unicode.org/reports/tr41/#UAX14)]. This is an example of
684[tailoring type](https://www.unicode.org/reports/tr14/#Tailoring) 1 (from that same document),
685changing the line breaking class assignment for some characters.
686
687If the values of `<quotationStart>` and `<quotationEnd>` are different, then:
688* if the value of `<quotationStart>` is a single character with linebreak class QU: Quotation, change its class to OP: Open Punctuation.
689* if the value of `<quotationEnd>` is a single character with linebreak class QU: Quotation, change its class to CL: Close Punctuation.
690Similarly for `<alternateQuotationStart>` and `<alternateQuotationEnd>`.
691
692Some characters with multiple uses should generally be excluded from this linebreak class remapping, such as:
693* U+2019 RIGHT SINGLE QUOTATION MARK, often used as apostrophe, should not be changed from QU; otherwise it will introduce breaks after apostrophe.
694* Several locales (mostly for central and eastern Europe) have U+201C LEFT DOUBLE QUOTATION MARK as `<quotationEnd>` or `<alternateQuotationEnd>`. However users in these locales may also encounter English text in which U+201C is used as `<quotationStart>`. In order to prevent improper breaks for English text, in these locales U+201C should not be changed from QU.
695
696## <a name="Measurement_System_Data" href="#Measurement_System_Data">Measurement System Data</a>
697
698```xml
699<!ELEMENT measurementData ( measurementSystem*, paperSize* ) >
700
701<!ELEMENT measurementSystem EMPTY >
702<!ATTLIST measurementSystem type ( metric | US | UK ) #REQUIRED >
703<!ATTLIST measurementSystem category ( temperature ) #IMPLIED >
704<!ATTLIST measurementSystem territories NMTOKENS #REQUIRED >
705
706<!ELEMENT paperSize EMPTY >
707<!ATTLIST paperSize type ( A4 | US-Letter ) #REQUIRED >
708<!ATTLIST paperSize territories NMTOKENS #REQUIRED >
709```
710
711The measurement system is the normal measurement system in common everyday use (except for date/time). For example:
712
713```xml
714<measurementData>
715 <measurementSystem type="metric" territories="001" />
716 <measurementSystem type="US" territories="LR MM US" />
717 <measurementSystem type="metric" category="temperature" territories="LR MM" />
718 <measurementSystem type="US" category="temperature" territories="BS BZ KY PR PW" />
719 <measurementSystem type="UK" territories="GB" />
720 <paperSize type="A4" territories="001" />
721 <paperSize type="US-Letter" territories="BZ CA CL CO CR GT MX NI PA PH PR SV US VE" />
722</measurementData>
723```
724
725The values are "metric", "US", or "UK"; others may be added over time.
726
727* The "metric" value indicates the use of SI [[ISO1000](tr35.md#ISO1000)] base or derived units, or non-SI units accepted for use with SI: for example, meters, kilograms, liters, and degrees Celsius.
728* The "US" value indicates the customary system of measurement as used in the United States: feet, inches, pints, quarts, degrees Fahrenheit, and so on.
729* The "UK" value indicates the mix of metric units and Imperial units (feet, inches, pints, quarts, and so on) used in the United Kingdom, in which Imperial volume units such as pint, quart, and gallon are different sizes than in the "US" customary system. For more detail about specific units for various usages, see **Part 6: Supplemental:** _[Preferred Units for Specific Usages](tr35-info.md#Preferred_Units_For_Usage)_.
730
731In some cases, it may be common to use different measurement systems for different categories of measurements. For example, the following indicates that for the category of temperature, in the regions LR and MM, it is more common to use metric units than US units.
732
733```xml
734<measurementSystem type="metric" category="temperature" territories="LR MM"/>
735```
736
737The `paperSize` attribute gives the height and width of paper used for normal business letters. The values are "A4" and "US-Letter".
738
739For both `measurementSystem` entries and `paperSize` entries, later entries for specific territories such as "US" will override the value assigned to that territory by earlier entries for more inclusive territories such as "001".
740
741The measurement information was formerly in the main LDML file, and had a somewhat different format.
742
743Again, for finer-grained detail about specific units for various usages, see **Part 6: Supplemental:** _[Preferred Units for Specific Usages](tr35-info.md#Preferred_Units_For_Usage)_.
744
745### <a name="Measurement_Elements" href="#Measurement_Elements">Measurement Elements (deprecated)</a>
746
747```xml
748<!ELEMENT measurement (alias | (measurementSystem?, paperSize?, special*)) >
749```
750
751The `measurement` element is deprecated in the main LDML files, because the data is more appropriately organized as connected to territories, not to linguistic data. Instead, the `measurementData` element in the supplemental data file should be used.
752
753## <a name="Unit_Elements" href="#Unit_Elements">Unit Elements</a>
754
755```xml
756<!ELEMENT units (alias | (unit*, unitLength*, durationUnit*, special*) ) >
757
758<!ELEMENT unitIdComponents ( unitIdComponent* ) >
759
760<!ELEMENT unitLength (alias | (compoundUnit*, unit*, coordinateUnit*, special*) ) >
761<!ATTLIST unitLength type (long | short | narrow) #REQUIRED >
762
763<!ELEMENT compoundUnit (alias | (compoundUnitPattern*, special*) ) >
764<!ATTLIST compoundUnit type NMTOKEN #REQUIRED >
765
766<!ELEMENT unit ( alias | ( gender*, displayName*, unitPattern*, perUnitPattern*, special* ) ) >
767<!ATTLIST unit type NMTOKEN #REQUIRED >
768
769<!ELEMENT gender ( #PCDATA )>
770
771<!ELEMENT durationUnit (alias | (durationUnitPattern*, special*) ) >
772<!ATTLIST durationUnit type NMTOKEN #REQUIRED >
773
774<!ELEMENT unitPattern ( #PCDATA ) >
775<!ATTLIST unitPattern count (0 | 1 | zero | one | two | few | many | other) #REQUIRED >
776
777<!ELEMENT compoundUnitPattern ( #PCDATA ) >
778<!ATTLIST compoundUnitPattern case NMTOKENS #IMPLIED >
779
780<!ELEMENT compoundUnitPattern1 ( #PCDATA ) >
781<!ATTLIST compoundUnitPattern1 count (0 | 1 | zero | one | two | few | many | other) #IMPLIED >
782<!ATTLIST compoundUnitPattern1 gender NMTOKENS #IMPLIED >
783<!ATTL IST compoundUnitPattern1 case NMTOKENS #IMPLIED >
784
785<!ELEMENT coordinateUnit ( alias | ( displayName*, coordinateUnitPattern*, special* ) ) >
786<!ELEMENT coordinateUnitPattern ( #PCDATA ) >
787<!ATTLIST coordinateUnitPattern type (north | east | south | west) #REQUIRED >
788
789<!ELEMENT durationUnitPattern ( #PCDATA ) >
790```
791
792These elements specify the localized way of formatting quantities of units such as years, months, days, hours, minutes and seconds— for example, in English, "1 day" or "3 days". The English rules that produce this example are as follows ({0} indicates the position of the formatted numeric value):
793
794```xml
795<unit type="duration-day">
796  <displayName>days</displayName>
797  <unitPattern count="one">{0} day</unitName>
798  <unitPattern count="other">{0} days</unitName>
799</unit>
800```
801
802The German rules are more complicated, because German has both gender and case. They thus have additional information, as illustrated below. Note that if there is no `@case` attribute, for backwards compatibility the implied case is nominative. The possible values for @case are listed in the `grammaticalFeatures` element. These follow the inheritance specified in Part 1, Section Lateral Inheritance](tr35.md#Lateral_Inheritance). Note that the additional grammar elements are only present in the `<unitLength type='long'>` form.
803
804```xml
805<unit type="duration-day">
806    <gender>masculine</gender>
807    <displayName>Tage</displayName>
808    <unitPattern count="one">{0} Tag</unitPattern>
809    <unitPattern count="one" case="accusative">{0} Tag</unitPattern>
810    <unitPattern count="one" case="dative">{0} Tag</unitPattern>
811    <unitPattern count="one" case="genitive">{0} Tages</unitPattern>
812    <unitPattern count="other">{0} Tage</unitPattern>
813    <unitPattern count="other" case="accusative">{0} Tage</unitPattern>
814    <unitPattern count="other" case="dative">{0} Tagen</unitPattern>
815    <unitPattern count="other" case="genitive">{0} Tage</unitPattern>
816    <perUnitPattern>{0} pro Tag</perUnitPattern>
817</unit>
818```
819
820These follow the inheritance specified in Part 1, Section Lateral Inheritance](tr35.md#Lateral_Inheritance). In addition to supporting language-specific plural cases such as “one” and “other”, unitPatterns support the language-independent explicit cases “0” and “1” for special handling of numeric values that are exactly 0 or 1; see [Explicit 0 and 1 rules](tr35-numbers.md#Explicit_0_1_rules).
821
822The `<unitPattern>` elements may be used to format quantities with decimal values; in such cases the choice of plural form will depend not only on the numeric value, but also on its formatting (see [Language Plural Rules](tr35-numbers.md#Language_Plural_Rules)). In addition to formatting units for stand-alone use, `<unitPattern>` elements are increasingly being used to format units for use in running text; for such usages, the developing [Grammatical Features](#Grammatical_Features) information will be very useful.
823
824Note that for certain plural cases, the unit pattern may not provide for inclusion of a numeric value—that is, it may not include “{0}”. This is especially true for the explicit cases “0” and “1” (which may have patterns like “zero seconds”). In certain languages such as Arabic and Hebrew, this may also be true with certain units for the plural cases “zero”, “one”, or “two” (in these languages, such plural cases are only used for the corresponding exact numeric values, so there is no concern about loss of precision without the numeric value).
825
826Units, like other values with a `count` attribute, use a special inheritance. See **Part 1: Core:** _[Multiple Inheritance](tr35.md#Multiple_Inheritance)_.
827
828The displayName is used for labels, such as in a UI. It is typically lowercased and as neutral a plural form as possible, and then uses the casing context for the proper display. For example, for English in a UI it would appear as titlecase:
829
830**Duration:**
831
832<!-- HTML: UI drawing -->
833<table><tbody>
834<tr><td>Days</td><td style="color: silver;">enter the vacation length</td></tr>
835</tbody></table>
836
837
838### <a name="Unit_Preference_and_Conversion" href="#Unit_Preference_and_Conversion">Unit Preference and Conversion Data</a>
839
840Different locales have different preferences for which unit or combination of units is used for a particular usage, such as measuring a person’s height. This is more fine-grained than merely a preference for metric versus US or UK measurement systems. For example, one locale may use meters alone, while another may use centimeters alone or a combination of meters and centimeters; a third may use inches alone, or (informally) a combination of feet and inches.
841
842The unit preference and conversion data allows formatting functions to pick the right measurement units for the locale and usage, and convert input measurement into those units. For example, a program (or database) could use 1.88 meters internally, but then for person-height have that measurement convert to _6 foot 2 inches_ for en-US and to _188 centimeters_ for de-CH. Using the unit display names and list formats, those results can then be displayed according to the desired width (eg _2″_ vs _2 in_ vs 2 _inches_) and using the locale display names and number formats.
843
844The size of the measurement can also be taken into account, so that an infant can have a height as _18 inches_, and an adult the height as _6 foot 2 inches._
845
846This data is supplied in **Part 6: [Supplemental](tr35-info.md#Contents)**: [Unit Conversion](tr35-info.md#Unit_Conversion) and [Unit Preferences](tr35-info.md#Unit_Preferences).
847
848### <a name="Unit_Identifiers" href="#Unit_Identifiers">Unit Identifiers</a>
849
850Units of measurement, such as _meter_, have defined programmatic identifiers as described in this section.
851The main identifier is a _core unit identifier_, which encompasses a number of simpler types of identifiers as follows.
852A secondary type of identifier is a _mixed unit identifier_, which combines a series of units such as _5° 30′_ or _3 feet 7 inches_.
853
854| Name             | Examples |
855| ---------------- | -------- |
856| core unit ID     | kilometer-per-hour, kilogram-meter, kilogram-meter-per-square-second, … <br/> _plus single unit IDs_ |
857| single unit ID   | square-foot, cubic-centimeter, … <br/> _plus prefixed unit IDs_ |
858| prefixed unit ID | kilometer, centigram, … <br/> _plus simple unit IDs_ |
859| simple unit ID   | meter, foot, inch, pound, pound-force, … |
860| mixed unit ID    | foot-and-inch, degree-and-arc-minute-and-arc-second |
861
862
863There is currently a ‘long’ style of unit identifier corresponding to each _core unit identifier_, as illustrated below.
864The only difference is that the long unit identifier adds a prefix which was used in the CLDR Survey Tool for grouping related identifiers together.
865The long unit identifers are used as a key in the translated unit names for locales, but dealing with these two styles is unnecessarily complicated, so the long unit identifiers are slated for deprecation (after replacing their use as a key for translations).
866
867| core unit ID | long unit ID |
868| ------------ | ------------ |
869| meter        | length-meter |
870| pound        | mass-pound   |
871| day          | duration-day |
872
873
874The list of valid CLDR simple unit identifiers is found in _[Section Validity Data](tr35.md#Validity_Data)_.
875These names should not be presented to end users, however: the translated names for different languages (or variants of English) are available in the CLDR localized data.
876All syntactically valid CLDR unit identifiers values that are not listed in the validity data are reserved by CLDR for additional future units.
877There is one exception: implementations that need to define their own unit identifiers can do so via _[Private-Use Units](#Private_Use_Units)_.
878
879A core unit identifier that is not a simple unit is called a _complex unit_ (aka _compound unit_).
880A complex unit identifier can be constructed from simple unit identifiers using multiplication (kilogram-meter) and division (kilogram-per-meter), powers (square-second), and prefixes (kilo-, 100-, kiBi).
881As usual, with division the part before the (first) -per- is called the _numerator_, and the part after it is called the _denominator_.
882
883The identifiers and unit conversion data are built to handle core unit IDs and mixed unit IDs based on their simple unit identifiers.
884Thus they support converting generated units such as inch-pound-per-square-week into comparable units, such as newtons.
885
886Where a core unit ID or mixed unit ID does not have an explicit translation in CLDR, a mechanism is supplied for producing a generated translation from the translations for the simple unit identifiers.
887See _[Compound Units](#compound-units)_.
888That can be used for less common units, such as _petasecond_.
889However, the generated translations may have the wrong spelling in languages where orthographic changes are needed when combining words.
890For example, “kilometer” can be formed in English from “kilo” and “meter”; the same process in Greek would combine “χιλιο” and “μέτρα” to get “χιλιομέτρα” — when the correct result is “χιλιόμετρα” (note the different location of the accent).
891Thus the most commonly-used complex units have explicit translations in CLDR.
892
893* A power (square, cubic, pow4, etc) modifies one prefixed unit ID, and must occur immediately before it in the identifier: square-foot, not foot-square.
894* Multiplication binds more tightly than division, so kilogram-meter-per-second-ampere is interpreted as (kg ⋅ m) / (s ⋅ a).
895* Thus if -per- occurs multiple times, each occurrence after the first is equivalent to a multiplication:
896  * kilogram-meter-per-second-ampere ⩧ kilogram-meter-per-second-per-ampere.
897
898#### Nomenclature
899
900As with other identifiers in CLDR, the American English spelling is used for unit identifiers. For the US spelling, see the [Preface of the Guide for the Use of the International System of Units (SI), NIST special publication 811](https://www.nist.gov/pml/special-publication-811), which is explicit about the discrepancy with the English-language BIPM spellings:
901
902> In keeping with U.S. and International practice (see Sec. C.2), this Guide uses the dot on the line as the decimal marker. In addition this Guide utilizes the American spellings “meter,” “liter,” and “deka” rather than “metre,” “litre,” and “deca,” and the name “metric ton” rather than “tonne.”
903
904#### Syntax
905
906The formal syntax for identifiers is provided below.
907Some of the constraints reference data from the unitIdComponents in [Unit_Conversion](tr35-info.md#Unit_Conversion).
908
909<!-- HTML: no header -->
910
911<table><tbody>
912<tr><td>unit_identifier</td><td>:=</td>
913    <td>core_unit_identifier<br/>
914        | mixed_unit_identifier<br/>
915        | long_unit_identifier</td></tr>
916
917<tr><td>core_unit_identifier</td><td>:=</td>
918    <td>product_unit ("-" per "-" product_unit)*<br/>
919        | per "-" product_unit ("-" per "-" product_unit)*
920        <ul><li><em>Examples:</em>
921            <ul><li>foot-per-second-per-second</li>
922                <li>per-second</li>
923            </ul></li>
924            <li><em>Note:</em> The normalized form will have only one "per"</li>
925        </ul></td></tr>
926
927<tr><td>per</td><td>:=</td>
928    <td>"per"
929        <ul>
930			<li><em>Constraint:</em> The token 'per' is the single value in &lt;unitIdComponent type="per"&gt;</li>
931		</ul></td></tr>
932
933<tr><td>product_unit</td><td>:=</td>
934        <td>single_unit ("-" single_unit)* ("-" pu_single_unit)*<br/>
935            | pu_single_unit ("-" pu_single_unit)*
936            <ul><li><em>Example:</em> foot-pound-force</li>
937                <li><em>Constraint:</em> No pu_single_unit may precede a single unit</li>
938            </ul></td></tr>
939
940<tr><td>single_unit</td><td>:=</td>
941    <td>number_prefix? dimensionality_prefix? simple_unit
942        <ul><li><em>Examples: </em>square-meter, or 100-square-meter</li></ul></td></tr>
943
944<tr><td>pu_single_unit</td><td>:=</td>
945    <td>"xxx-" single_unit | "x-" single_unit
946    <ul><li><em>Example:</em> xxx-square-knuts (a Harry Potter unit)</li>
947        <li><em>Note:</em> "x-" is only for backwards compatibility</li>
948        <li>See <a href="#Private_Use_Units">Private-Use Units</a></li>
949    </ul></td></tr>
950
951<tr><td>number_prefix</td><td>:=</td>
952    <td>("1"[0-9]+ | [2-9][0-9]*) "-"
953        <ul><li><em>Examples:</em>
954            <ul><li>kilowatt-hour-per-100-kilometer</li>
955                <li>gallon-per-100-mile</li>
956                <li>per-200-pound</li>
957            </ul></li>
958            <li><em>Note:</em> The number is an integer greater than one.</li>
959        </ul></td></tr>
960
961<tr><td>dimensionality_prefix</td><td>:=</td>
962    <td>"square-"<p>| "cubic-"<p>| "pow" ([2-9]|1[0-5]) "-"
963        <ul>
964			<li><em>Constraint:</em> must be value in: &lt;unitIdComponent type="power"&gt;.</li>
965			<li><em>Note:</em> "pow2-" and "pow3-" canonicalize to "square-" and "cubic-"</li>
966			<li><em>Note:</em> These are values in &lt;unitIdComponent type="power"&gt;</li>
967		</ul></td></tr>
968
969<tr><td>simple_unit</td><td>:=</td>
970    <td>(prefix_component "-")* (prefixed_unit | base_component) ("-" suffix_component)*<br/>
971		|  currency_unit<br/>
972		| "em" | "g" | "us" | "hg" | "of"
973        <ul>
974		<li><em>Examples:</em> kilometer, meter, cup-metric, fluid-ounce, curr-chf, em</li>
975		<li><em>Note:</em> Three simple units are currently allowed as legacy usage, for tokens that wouldn’t otherwise be a base_component due to length (eg, "<strong>g</strong>-force").
976			We will likely deprecate those and add conformant aliases in the future: the "hg" and "of" are already only in deprecated simple_units.</li>
977        </ul></td></tr>
978
979<tr><td>prefixed_unit</td><td></td>
980    <td>prefix base_component<ul><li><em>Example: </em>kilometer</li></ul></td></tr>
981
982<tr><td>prefix</td><td></td>
983    <td>si_prefix | binary_prefix</td></tr>
984
985<tr><td>si_prefix</td><td>:=</td>
986    <td>"deka" | "hecto" | "kilo", …
987        <ul><li><em>Note:</em> See full list at <a href="https://www.nist.gov/pml/special-publication-811">NIST special publication 811</a></li></ul></td></tr>
988
989<tr><td>binary_prefix</td><td>:=</td>
990    <td>"kibi", "mebi", …
991        <ul><li><em>Note:</em> See full list at <a href="https://physics.nist.gov/cuu/Units/binary.html">Prefixes for binary multiples</a></li></ul></td></tr>
992
993<tr><td>prefix_component</td><td>:=</td>
994    <td>[a-z]{3,∞}
995        <ul><li><em>Constraint:</em> must be value in: &lt;unitIdComponent type="prefix"&gt;.</li></ul></td></tr>
996
997<tr><td>base_component</td><td>:=</td>
998    <td>[a-z]{3,∞}
999        <ul><li><em>Constraint:</em> must not be a value in any of the following:<br>
1000			&lt;unitIdComponent type="prefix"&gt;<br>
1001			or &lt;unitIdComponent type="suffix"&gt; <br>
1002			or &lt;unitIdComponent type="power"&gt;<br>
1003			or &lt;unitIdComponent type="and"&gt;<br>
1004			or &lt;unitIdComponent type="per"&gt;.
1005		</li>
1006		<li><em>Constraint:</em> must not have a prefix as an initial segment.</li>
1007		<li><em>Constraint:</em> no two different base_components will share the first 8 letters.
1008				(<b>For more information, see <a href="#Unit_Identifier_Uniqueness">Unit Identifier Uniqueness</a>.)</b>
1009			</li>
1010		</ul>
1011	</td></tr>
1012
1013<tr><td>suffix_component</td><td>:=</td>
1014    <td>[a-z]{3,∞}
1015        <ul>
1016			<li><em>Constraint:</em> must be value in: &lt;unitIdComponent type="suffix"&gt;</li>
1017		</ul></td></tr>
1018
1019<tr><td>mixed_unit_identifier</td><td>:=</td>
1020    <td>(single_unit | pu_single_unit) ("-" and "-" (single_unit | pu_single_unit ))*
1021        <ul><li><em>Example: foot-and-inch</em></li>
1022		</ul></td></tr>
1023
1024<tr><td>and</td><td>:=</td>
1025    <td>"and"
1026		<ul>
1027			<li><em>Constraint:</em> The token 'and' is the single value in &lt;unitIdComponent type="and"&gt;</li>
1028		</ul></td></tr>
1029
1030<tr><td>long_unit_identifier</td><td>:=</td>
1031    <td>grouping "-" core_unit_identifier</td></tr>
1032
1033<tr><td>grouping</td><td>:=</td>
1034    <td>[a-z]{3,∞}</td></tr>
1035
1036<tr><td>currency_unit</td><td>:=</td>
1037    <td>"curr-" [a-z]{3}
1038        <ul>
1039			<li><em>Constraint:</em> The first part of the currency_unit is a standard prefix; the second part of the currency unit must be a valid <a href="tr35.md#UnicodeCurrencyIdentifier">Unicode currency identifier</a>.</li>
1040		</ul>
1041		<ul>
1042            <li><em>Examples:</em> <b>curr-eur</b>-per-square-meter, or pound-per-<b>curr-usd</b></li>
1043			<li><em>Note:</em> CLDR does not provide conversions for currencies; this is only intended for formatting.
1044				The locale data for currencies is supplied in the <code>currencies</code> element, not in the <code>units</code> element.</li>
1045        </ul>
1046	</td></tr>
1047
1048</tbody></table>
1049
1050Note that while the syntax allows for number_prefixes in multiple places, the typical use case is only one instance, after a "-per-".
1051
1052The simple_unit structure does not allow for any two simple_units to overlap.
1053That is, there are no cases where simple_unit1 consists of X-Y and simple_unit2 consists of Y-Z.
1054This was not true in previous versions of LDML: cup-metric overlapped with metric-ton.
1055That meant that the unit identifiers for the product_unit of cup and metric-ton and the product_unit of cup-metric and ton were ambiguous.
1056
1057The constraint that the identifiers can't overlap also means that parsing of multiple-subtag simple units is simpler.
1058For example:
1059* When a prefix_component is encountered, one can collect any other prefix-components, then one base_component, then any suffix components, and stop.
1060* Similarly, when a base_component is encountered, one can collect any suffix components, and stop.
1061* Encountering a suffix_component in any other circumstance is an error.
1062
1063### <a name="Unit_Identifier_Uniqueness" href="#Unit_Identifier_Uniqueness">Unit Identifier Uniqueness</a>
1064CLDR Unit Identifiers can be used as values in locale identifiers. When that is done, the syntax is modified whenever a `prefixed_unit` would be longer than 8 characters. In such a case:
1065
1066* If there is no `prefix` the `prefixed_unit` is truncated to 8 characters.
1067* If there is a `prefix`, a hyphen is added between the `prefix` and the `base_component`. If that `base_component` is longer than 8 characters, it is truncated to 8 characters.
1068
1069_Example_
1070| Unit identifer | BCP47 syntax example | Comment |
1071| ----      | ----               | ----                           |
1072| kilogram  | en-u-ux-kilogram   | kilogram fits in 8 characters  |
1073| centilux  | en-u-ux-centilux   | centilux fixs in 8 characters  |
1074| steradian | en-u-ux-steradia   | steradian exceeds 8 characters |
1075| centigram | en-u-ux-centi-gram | centigram exceeds 8 characters |
1076| kilometer | en-u-ux-kilo-meter | kilometer exceeds 8 characters |
1077| quectolux | en-u-ux-kilo-meter | kilometer exceeds 8 characters |
1078
1079This requires that each of the elements in base_components are unique to eight letters, that is: **no two different base_components will share the first 8 letters**.
1080
1081The reason that the `prefixed_unit` as a whole is not simply truncated to 8 characters is that would impose too strict a constraint. There  are 5 letter prefixes such as 'centi' and more recently 6 letter prefixes such as 'quecto'. That would cause prefixed `base_component` as short as 'gram' and 'gray' to be ambiguous when truncated to 8 letters: 'centigra'; and 'lumen' and 'lux' would fail with the 6 letter prefixes.
1082
1083### <a name="Example_Units" href="#Example_Units">Example Units</a>
1084
1085The following table contains examples of groupings and units currently defined by CLDR.
1086The units in CLDR are not comprehensive; it is anticipated that more will be added over time.
1087The complete list of supported units is in the validity data: see _[Section Validity Data](tr35.md#Validity_Data)_.
1088
1089| Type           | Core Unit Identifier     | Compound? | Sample Format  |
1090| -------------- | ------------------------ | --------- | -------------- |
1091| _acceleration_ | g-force                  | simple    | {0} G          |
1092| _acceleration_ | meter-per-square-second  | compound  | {0} m/s²       |
1093| _angle_        | revolution               | simple    | {0} rev        |
1094| _angle_        | radian                   | simple    | {0} rad        |
1095| _angle_        | degree                   | simple    | {0}°           |
1096| _angle_        | arc-minute               | simple    | {0}′           |
1097| _angle_        | arc-second               | simple    | {0}″           |
1098| _area_         | square-kilometer         | simple    | {0} km²        |
1099| _area_         | hectare                  | simple    | {0} ha         |
1100| ...            | ...                      | ...       | ...            |
1101| _area_         | square-inch              | simple    | {0} in²        |
1102| _area_         | dunam                    | simple    | {0} dunam      |
1103| _concentr_     | karat                    | simple    | {0} kt         | dimensionless |
1104| _concentr_     | milligram-per-deciliter  | compound  | {0} mg/dL      |
1105| _concentr_     | millimole-per-liter      | compound  | {0} mmol/L     |
1106| _concentr_     | permillion               | compound  | {0} ppm        | dimensionless |
1107| _concentr_     | percent                  | simple    | {0}%           | dimensionless |
1108| _concentr_     | permille                 | simple    | {0}‰           | dimensionless |
1109| _concentr_     | permyriad                | simple    | {0}‱          | dimensionless |
1110| _concentr_     | mole                     | simple    | {0} mol        | dimensionless |
1111| _consumption_  | liter-per-kilometer      | compound  | {0} L/km       |
1112| _consumption_  | liter-per-100-kilometer  | compound  | {0} L/100km    |
1113| _consumption_  | mile-per-gallon (US)     | compound  | {0} mpg        |
1114| _consumption_  | mile-per-gallon-imperial | compound  | {0} mpg Imp.   |
1115| _digital_      | petabyte                 | simple    | {0} PB         |
1116| ...            | ...                      | ...       | ...            |
1117| _digital_      | byte                     | simple    | {0} byte       |
1118| _digital_      | bit                      | simple    | {0} bit        |
1119| _duration_     | century                  | simple    | {0} c          |
1120| _duration_     | year                     | simple    | {0} y          |
1121| _duration_     | year-person              | simple    | {0} y          | for duration or age related to a person |
1122| _duration_     | month                    | simple    | {0} m          |
1123| _duration_     | month-person             | simple    | {0} m          | for duration or age related to a person |
1124| _duration_     | week                     | simple    | {0} w          |
1125| _duration_     | week-person              | simple    | {0} w          | for duration or age related to a person |
1126| _duration_     | day                      | simple    | {0} d          |
1127| _duration_     | day-person               | simple    | {0} d          | for duration or age related to a person |
1128| _duration_     | hour                     | simple    | {0} h          |
1129| ...            | ...                      | ...       | ...            |
1130| _duration_     | nanosecond               | simple    | {0} ns         |
1131| _electric_     | ampere                   | simple    | {0} A          |
1132| _electric_     | milliampere              | simple    | {0} mA         |
1133| _electric_     | ohm                      | simple    | {0} Ω          |
1134| _electric_     | volt                     | simple    | {0} V          |
1135| _energy_       | kilocalorie              | simple    | {0} kcal       |
1136| _energy_       | calorie                  | simple    | {0} cal        |
1137| _energy_       | foodcalorie              | simple    | {0} Cal        |
1138| _energy_       | kilojoule                | simple    | {0} kJ         |
1139| _energy_       | joule                    | simple    | {0} J          |
1140| _energy_       | kilowatt-hour            | simple    | {0} kWh        |
1141| _energy_       | electronvolt             | simple    | {0} eV         |
1142| _energy_       | british-thermal-unit     | simple    | {0} Btu        |
1143| _force_        | pound-force              | simple    | {0} lbf        |
1144| _force_        | newton                   | simple    | {0} N          |
1145| _frequency_    | gigahertz                | simple    | {0} GHz        |
1146| _frequency_    | megahertz                | simple    | {0} MHz        |
1147| _frequency_    | kilohertz                | simple    | {0} kHz        |
1148| _frequency_    | hertz                    | simple    | {0} Hz         |
1149| _length_       | kilometer                | simple    | {0} km         |
1150| ...            | ...                      | ...       | ...            |
1151| _length_       | inch                     | simple    | {0} in         |
1152| _length_       | parsec                   | simple    | {0} pc         |
1153| _length_       | light-year               | simple    | {0} ly         |
1154| _length_       | astronomical-unit        | simple    | {0} au         |
1155| _length_       | furlong                  | simple    | {0} fur        |
1156| _length_       | fathom                   | simple    | {0} fm         |
1157| _length_       | nautical-mile            | simple    | {0} nmi        |
1158| _length_       | mile-scandinavian        | simple    | {0} smi        |
1159| _length_       | point                    | simple    | {0} pt         | typographic point, 1/72 inch |
1160| _length_       | solar-radius             | simple    | {0} R☉        |
1161| _light_        | lux                      | simple    | {0} lx         |
1162| _light_        | solar-luminosity         | simple    | {0} L☉        |
1163| _mass_         | metric-ton               | simple    | {0} t          |
1164| _mass_         | kilogram                 | simple    | {0} kg         |
1165| ...            | ...                      | ...       | ...            |
1166| _mass_         | ounce                    | simple    | {0} oz         |
1167| _mass_         | ounce-troy               | simple    | {0} oz t       |
1168| _mass_         | carat                    | simple    | {0} CD         |
1169| _mass_         | dalton                   | simple    | {0} Da         |
1170| _mass_         | earth-mass               | simple    | {0} M⊕         |
1171| _mass_         | solar-mass               | simple    | {0} M☉        |
1172| _power_        | gigawatt                 | simple    | {0} GW         |
1173| ...            | ...                      | ...       | ...            |
1174| _power_        | milliwatt                | simple    | {0} mW         |
1175| _power_        | horsepower               | simple    | {0} hp         |
1176| _pressure_     | hectopascal              | simple    | {0} hPa        |
1177| _pressure_     | millimeter-ofhg          | simple    | {0} mm Hg      |
1178| _pressure_     | pound-force-per-square-inch | compound | {0} psi      |
1179| _pressure_     | inch-ofhg                | simple    | {0} inHg       |
1180| _pressure_     | millibar                 | simple    | {0} mbar       |
1181| _pressure_     | atmosphere               | simple    | {0} atm        |
1182| _pressure_     | kilopascal               | simple    | {0} kPa        |
1183| _pressure_     | megapascal               | simple    | {0} MPa        |
1184| _speed_        | kilometer-per-hour       | compound  | {0} km/h       |
1185| _speed_        | meter-per-second         | compound  | {0} m/s        |
1186| _speed_        | mile-per-hour            | compound  | {0} mi/h       |
1187| _speed_        | knot                     | simple    | {0} kn         |
1188| _temperature_  | generic                  | simple    | {0}°           |
1189| _temperature_  | celsius                  | simple    | {0}°C          |
1190| _temperature_  | fahrenheit               | simple    | {0}°F          |
1191| _temperature_  | kelvin                   | simple    | {0} K          |
1192| _torque_       | pound-force-foot         | simple    | {0} lbf⋅ft     |
1193| _torque_       | newton-meter             | simple    | {0} N⋅m        |
1194| _volume_       | cubic-kilometer          | simple    | {0} km³        |
1195| ...            | ...                      | ...       | ...            |
1196| _volume_       | cubic-inch               | simple    | {0} in³        |
1197| _volume_       | megaliter                | simple    | {0} ML         |
1198| ...            | ...                      | ...       | ...            |
1199| _volume_       | pint                     | simple    | {0} pt         |
1200| _volume_       | cup                      | simple    | {0} c          |
1201| _volume_       | fluid-ounce (US)         | simple    | {0} fl oz      |
1202| _volume_       | fluid-ounce-imperial     | simple    | {0} fl oz Imp. |
1203| _volume_       | tablespoon               | simple    | {0} tbsp       |
1204| _volume_       | teaspoon                 | simple    | {0} tsp        |
1205| _volume_       | barrel                   | simple    | {0} bbl        |
1206
1207There are three widths: **long**, **short**, and **narrow**. As usual, the narrow forms may not be unique: in English, 1′ could mean 1 minute of arc, or 1 foot. Thus narrow forms should only be used where the context makes the meaning clear.
1208
1209Where the unit of measurement is one of the [International System of Units (SI)](https://physics.nist.gov/cuu/Units/units.html), the short and narrow forms will typically use the international symbols, such as “mm” for millimeter. They may, however, be different if that is customary for the language or locale. For example, in Russian it may be more typical to see the Cyrillic characters “мм”.
1210
1211Units are sometimes included for translation even where they are not typically used in a particular locale, such as kilometers in the US, or inches in Germany. This is to account for use by travelers and specialized domains, such as the German “Fernseher von 32 bis 55 Zoll (80 bis 140 cm)” for TV screen size in inches and centimeters.
1212
1213For temperature, there is a special unit `<unit type="temperature-generic">`, which is used when it is clear from context whether Celcius or Fahrenheit is implied.
1214
1215For duration, there are special units such as `<unit type="duration-year-person">` and `<unit type="duration-year-week">` for indicating the age of a person, which requires special forms in some languages. For example, in "zh", references to a person being 3 days old or 30 years old would use the forms “他3天大” and “他30岁” respectively.
1216
1217<a name="compoundUnitPattern"></a><a name="perUnitPatterns"></a>
1218
1219### Compound Units
1220
1221A common combination of units is X per Y, such as _miles per hour_ or _liters per second_ or _kilowatt-hours_.
1222
1223There are different types of structure used to build the localized name of compound units. All of these follow the inheritance specified in [Part 1, Lateral Inheritance](tr35.md#Lateral_Inheritance).
1224
1225**Prefixes** are for powers of 10 and powers of 1024 (the latter only used with digital units of measure). These are invariant for case, gender, or plural (though those could be added in the future if needed by a language).
1226
1227```xml
1228<compoundUnit type="10p9">
1229  <unitPrefixPattern>Giga{0}</unitPrefixPattern>
1230</compoundUnit>
1231
1232<compoundUnit type="1024p3">
1233  <unitPrefixPattern>Gibi{0}</unitPrefixPattern>
1234</compoundUnit>
1235```
1236
1237**number prefixes** are integers within a single_unit, such as in liter-per-**100-kilometer**. The formatting for these uses the normal number formats for the locale. Their presence does have an effect on the plural formatting of the simple unit in a "per" form. For example, in English you would write 3 liters per kilometer (singular "kilometer") but 3 liters per 100 kilometers (plural kilometers).
1238
1239**compoundUnitPatterns** are used for compounding units by multiplication or division: kilowatt-hours, or meters per second. These are invariant for case, gender, or plural (though those could be added in the future if needed by a language).
1240
1241```xml
1242<compoundUnit type="per">
1243  <compoundUnitPattern>{0} pro {1}</compoundUnitPattern>
1244</compoundUnit>
1245
1246<compoundUnit type="times">
1247  <compoundUnitPattern>{0}⋅{1}</compoundUnitPattern>
1248</compoundUnit>
1249```
1250
1251There can be at most one "per" pattern used in producing a compound unit, while the "times" pattern can be used multiple times.
1252
1253`compoundUnitPattern1`s are used for expressing powers, such as square meter or cubic foot. These are the most complicated, since they can vary by plural category (count), by case, and by gender. However, these extra attributes are only used if they are present in the `grammaticalFeatures` element for the language in question. See [Grammatical Features](#Grammatical_Features). Note that the additional grammar elements are only present in the `<unitLength type='long'>` form.
1254
1255```xml
1256<compoundUnit type="power2">
1257  <compoundUnitPattern1>{0} kw.</compoundUnitPattern1>
1258  <compoundUnitPattern1 count="one">{0} kwadratowe</compoundUnitPattern1>
1259  <compoundUnitPattern1 count="one" case="accusative">{0} kwadratowe</compoundUnitPattern1>
1260  <compoundUnitPattern1 count="one" case="dative">{0} kwadratowemu</compoundUnitPattern1>
1261  <compoundUnitPattern1 count="one" case="genitive">{0} kwadratowego</compoundUnitPattern1>
1262  <compoundUnitPattern1 count="one" case="instrumental">{0} kwadratowym</compoundUnitPattern1>
1263  <compoundUnitPattern1 count="one" case="locative">{0} kwadratowym</compoundUnitPattern1>
1264  <compoundUnitPattern1 count="one" case="vocative">{0} kwadratowe</compoundUnitPattern1>
1265  <compoundUnitPattern1 count="one" gender="feminine">{0} kwadratowa</compoundUnitPattern1>
1266  <compoundUnitPattern1 count="one" gender="feminine" case="accusative">{0} kwadratową</compoundUnitPattern1>
1267  <compoundUnitPattern1 count="one" gender="feminine" case="dative">{0} kwadratowej</compoundUnitPattern1>
1268  <compoundUnitPattern1 count="one" gender="feminine" case="genitive">{0} kwadratowej</compoundUnitPattern1>
1269  <compoundUnitPattern1 count="one" gender="feminine" case="instrumental">{0} kwadratową</compoundUnitPattern1>
1270  <compoundUnitPattern1 count="one" gender="feminine" case="locative">{0} kwadratowej</compoundUnitPattern1>
1271  <compoundUnitPattern1 count="one" gender="feminine" case="vocative">{0} kwadratowa</compoundUnitPattern1>
1272  <compoundUnitPattern1 count="one" gender="inanimate">{0} kwadratowy</compoundUnitPattern1>
1273  <compoundUnitPattern1 count="one" gender="inanimate" case="accusative">{0} kwadratowy</compoundUnitPattern1>
1274  <compoundUnitPattern1 count="one" gender="inanimate" case="dative">{0} kwadratowemu</compoundUnitPattern1>
1275  <compoundUnitPattern1 count="one" gender="inanimate" case="genitive">{0} kwadratowego</compoundUnitPattern1>
1276  <compoundUnitPattern1 count="one" gender="inanimate" case="instrumental">{0} kwadratowym</compoundUnitPattern1>
1277  <compoundUnitPattern1 count="one" gender="inanimate" case="locative">{0} kwadratowym</compoundUnitPattern1>
1278  <compoundUnitPattern1 count="one" gender="inanimate" case="vocative">{0} kwadratowy</compoundUnitPattern1>
1279  <compoundUnitPattern1 count="few">{0} kwadratowe</compoundUnitPattern1>
1280  <compoundUnitPattern1 count="few" case="accusative">{0} kwadratowe</compoundUnitPattern1>
1281  <compoundUnitPattern1 count="few" case="dative">{0} kwadratowym</compoundUnitPattern1>
12821283```
1284
1285Some units already have 'precomputed' forms, such as **kilometer-per-hour**; where such units exist, they should be used in preference.
1286
1287If there is no precomputed form, the following process in pseudocode is used to generate a pattern for the compound unit.
1288
1289**pattern(unitId, locale, length, pluralCategory, caseVariant)**
1290
12911.  If the unitId is empty or invalid, fail
12922.  Put the unitId into normalized order: hour-kilowatt => kilowatt-hour, meter-square-meter-per-second-second => cubic-meter-per-square-second
12933.  Set result to be getValue(unitId with length, pluralCategory, caseVariant)
1294    1. If result is not empty, return it
12954.  Divide the unitId into numerator (the part before the "-per-") and denominator (the part after the "-per-). If both are empty, fail
12965.  Set both globalPlaceholder and globalPlaceholderPosition to be empty
12976.  Set numeratorUnitString to patternTimes(numerator, length, per0(pluralCategory), per0(caseVariant))
12987.  Set denominatorUnitString to patternTimes(denominator, length, per1(pluralCategory), per1(caseVariant))
12998.  Set perPattern to be getValue(per, locale, length)
13009.  If the denominatorString is empty, set result to numeratorString, otherwise set result to format(perPattern, numeratorUnitString, denominatorUnitString)
130110. return format(result, globalPlaceholder, globalPlaceholderPosition)
1302
1303**patternTimes(product_unit, locale, length, pluralCategory, caseVariant)**
1304
13051. Set hasMultiple to true iff product_unit has more than one single_unit
13062. Set timesPattern to be getValue(times, locale, length)
13073. Set result to be empty
13084. Set multiplier to be empty
13094. For each single_unit in product_unit
1310   1.  If hasMultiple
1311       1. Set singlePluralCategory to be times0(pluralCategory)
1312       2. Set singleCaseVariant to be times0(caseVariant)
1313       3. Set pluralCategory to be times1(pluralCategory)
1314       4. Set caseVariant to be times1(caseVariant)
1315   2.  If the singleUnit is a currency_unit
1316       1. Set coreUnit to be the formatted currency according to the pluralCategory
1317	   2. Set the gender to the default unit gender for the locale
1318	   3. Goto step 11
1319   2.  Get the gender of that single_unit
1320   3.  If singleUnit starts with a dimensionality_prefix, such as 'square-'
1321       1. set dimensionalityPrefixPattern to be getValue(that dimensionality_prefix, locale, length, singlePluralCategory, singleCaseVariant, gender), such as "{0} kwadratowym"
1322       2. set singlePluralCategory to be power0(singlePluralCategory)
1323       3. set singleCaseVariant to be power0(singleCaseVariant)
1324       4. remove the dimensionality_prefix from singleUnit
1325   4.  if singleUnit starts with an si_prefix, such as 'centi' and/or a number_prefix such as '100'
1326       1. set siPrefixPattern to be getValue(that si_prefix, locale, length), such as "centy{0}"
1327       2. set singlePluralCategory to be prefix0(singlePluralCategory)
1328       3. set singleCaseVariant to be prefix0(singleCaseVariant)
1329       4. remove the si_prefix from singleUnit
1330	   5. set multiplier to be the locales integer numberFormat of number_prefix.
1331   5.  Set corePattern to be the getValue(singleUnit, locale, length, singlePluralCategory, singleCaseVariant), such as "{0} metrem"
1332   6.  Extract(corePattern, coreUnit, placeholder, placeholderPosition) from that pattern.
1333   7.  If the position is _middle_, then fail
1334   8.  If globalPlaceholder is empty
1335       1. Set globalPlaceholder to placeholder
1336       2. Set globalPlaceholderPosition to placeholderPosition
1337   9.  If siPrefixPattern is not empty
1338       1. Set coreUnit to be the combineLowercasing(locale, length, siPrefixPattern, coreUnit)
1339   10. If dimensionalityPrefixPattern is not empty
1340       1. Set coreUnit to be the combineLowercasing(locale, length, dimensionalityPrefixPattern, coreUnit)
1341   10. If multiplier is not empty
1342       1. Combine the multiplier with coreUnit, using placeholder and placeholderPosition
1343   11. If the result is empty, set result to be coreUnit
1344   12. Otherwise set result to be format(timesPattern, result, coreUnit)
13455. Return result
1346
1347__Note: CLDR does not currently have gender or case data for currency units, so the formatting will not be optimal for inflected languages.__
1348
1349**combineLowercasing(locale, length, prefixPattern, coreUnit)**
1350
13511. If the length is "long" and the prefixPattern contains no spaces, lowercase the coreUnit according to the locale, thus "Quadrat{0}" causes "Zentimeter" to become "zentimeter"
13522. return format(prefixPattern, unitPattern), eg "Quadratzentimeter"
1353
1354**format(pattern, arguments…)**
1355
13561. return the result of substituting the arguments for the placeholders {0}, {1}, etc.
1357
1358**getValue(key, locale, length, variants…)**
1359
13601. return the element value in the locale for the path corresponding to the key, locale, length, and variants — using normal inheritance including [Lateral Inheritance](tr35.md#Multiple_Inheritance) and [Parent Locales](tr35.md#Parent_Locales).
1361
1362**Extract(corePattern, coreUnit, placeholder, placeholderPosition)**
1363
13641. Find the position of the **placeholder** in the core pattern
13652. Set **placeholderPosition** to that position (start, middle, or end)
13663. Remove the **placeholder** from the **corePattern** and set **coreUnit** to that result
1367
1368**per0(...), times0(...), etc.**
1369
13701. These represent the **deriveComponent** data values from **[Grammatical Derivations](#Grammatical_Derivations)**, where value0 of the per-structure is given as per0(...), and so on.
13712. "power" corresponds to dimensionality_prefix, while "prefix" corresponds to si_prefix.
1372
1373If the locale does not provide full modern coverage, the process could fall back to root locale for some localized patterns. That may give a "ransom-note" effect for the user. To avoid that, it may be preferable to abort the process at that point, and then localize the unitId for the root locale.
1374
1375If a unit is not supported by root, then the localization is not supported by CLDR and will fail.
1376
1377#### Precomposed Compound Units
1378
1379At each point in the process, if there is a precomposed form for a segment of the unitId, then that precomposed form should be used instead. For example, if there is a pattern in the locale for (square-kilometer, length, singlePluralCategory, singleCaseVariant, gender), then it should be used instead of composing the name from "square" and "kilometer".
1380
1381There is also a precomposed **perUnitPattern** which is used as the denominator with another unit name. For example, a form such as "{0} per second" can be used to form "2 feet **per second**". The difference between these is that in some inflected languages, the compoundUnit cannot be used to form grammatical phrases. This is typically because the "per" + "second" combine in a non-trivial way. The `perUnitPattern` should be applied if the denominator has only one element, and matches the `perUnitPattern` type.
1382
1383### <a name="Unit_Sequences" href="#Unit_Sequences">Unit Sequences (Mixed Units)</a>
1384
1385Units may be used in composed sequences (aka _mixed units_), such as **5° 30′** for 5 degrees 30 minutes, or **3 ft 2 in.** For that purpose, the appropriate width of the unit `listPattern` can be used to compose the units in a sequence.
1386
1387```xml
1388<listPattern type="unit"> (for the long form)
1389<listPattern type="unit-narrow">
1390<listPattern type="unit-short">
1391```
1392
1393In such a sequence, decimal fractions are typically only displayed for the last element of the sequence, if at all.
1394
1395### <a name="durationUnit" href="#durationUnit">durationUnit</a>
1396
1397The durationUnit is a special type of unit used for composed time unit durations.
1398
1399```xml
1400<durationUnit type="hms">
1401  <durationUnitPattern>h:mm:ss</durationUnitPattern> <!-- 33:04:59 -->
1402</durationUnit>
1403```
1404
1405The type contains a skeleton, where 'h' stands for hours, 'm' for minutes, and 's' for seconds. These are the same symbols used in availableFormats, except that there is no need to distinguish different forms of the hour.
1406
1407### <a name="coordinateUnit" href="#coordinateUnit">coordinateUnit</a>
1408
1409The **coordinateUnitPattern** is a special type of pattern used for composing degrees of latitude and longitude, with an indicator of the quadrant. There are exactly 4 type values, plus a displayName for the items in this category. An angle is composed using the appropriate combination of the **angle-degrees**, **angle-arc-minute** and **angle-arc-second** values. It is then substituted for the placeholder field {0} in the appropriate **coordinateUnit** pattern.
1410
1411```xml
1412<displayName>direction</displayName>
1413<coordinateUnitPattern type="east">{0}E</coordinateUnitPattern>
1414<coordinateUnitPattern type="north">{0}N</coordinateUnitPattern>
1415<coordinateUnitPattern type="south">{0}S</coordinateUnitPattern>
1416<coordinateUnitPattern type="west">{0}W</coordinateUnitPattern>
1417```
1418
1419### <a name="Territory_Based_Unit_Preferences" href="#Territory_Based_Unit_Preferences">Territory-Based Unit Preferences</a>
1420
1421Different locales have different preferences for which unit or combination of units is used for a particular usage, such as measuring a person’s height. This is more fine-grained than merely a preference for metric versus US or UK measurement systems. For example, one locale may use meters alone, while another may use centimeters alone or a combination of meters and centimeters; a third may use inches alone, or (informally) a combination of feet and inches.
1422
1423The `<unitPreferenceData>` element, described in [Preferred Units for Specific Usages](tr35-info.md#Preferred_Units_For_Usage), provides information on which unit or combination of units is used for various purposes in different locales, with options for the level of formality and the scale of the measurement (e.g. measuring the height of an adult versus that of an infant).
1424
1425### <a name="Private_Use_Units" href="#Private_Use_Units">Private-Use Units</a>
1426
1427CLDR has reserved the "xxx-" prefix in the simple_unit part of the unit identifier BNF for private-use units. CLDR will never define a type, simple unit, or compound unit such that the unit identifier starts with "xxx-", ends with "-xxx", or contains "-xxx-".
1428
1429For example, if you wanted to define your own unit "foo", you could use the simple unit "xxx-foo".
1430
1431It is valid to construct compound units containing one or more private-use simple units. For example, "xxx-foo-per-second" and "xxx-foo-per-xxx-bar" are both valid core unit identifiers for compound units.
1432
1433As explained earlier, CLDR defines all associations between types and units. It is therefore not possible to construct a valid long unit identifier containing a private-use unit; only core unit identifiers are possible.
1434
1435The older syntax used “x-”, which was expanded to “xxx-” to simplify use with BCP47 syntax. That should be converted to “xxx-”.
1436
1437## <a name="POSIX_Elements" href="#POSIX_Elements">POSIX Elements</a>
1438
1439```xml
1440<!ELEMENT posix (alias | (messages*, special*)) >
1441<!ELEMENT messages (alias | ( yesstr*, nostr*)) >
1442```
1443
1444The following are included for compatibility with POSIX.
1445
1446```xml
1447<posix>
1448    <posix:messages>
1449        <posix:yesstr>ja</posix:yesstr>
1450        <posix:nostr>nein</posix:nostr>
1451    </posix:messages>
1452</posix>
1453```
1454
14551. The values for yesstr and nostr contain a colon-separated list of strings that would normally be recognized as "yes" and "no" responses. For cased languages, this shall include only the lower case version. POSIX locale generation tools must generate the upper case equivalents, and the abbreviated versions, and add the English words wherever they do not conflict. Examples:
1456    * ja → ja:Ja:j:J:yes:Yes:y:Y
1457    * ja → ja:Ja:j:J:yes:Yes // exclude y:Y if it conflicts with the native "no".
14582. The older elements `yesexpr` and `noexpr` are deprecated. They should instead be generated from `yesstr` and `nostr` so that they match all the responses.
1459
1460So for English, the appropriate strings and expressions would be as follows:
1461
1462```
1463yesstr "yes:y"
1464nostr "no:n"
1465```
1466
1467The generated yesexpr and noexpr would be:
1468
1469```
1470yesexpr "^([yY]([eE][sS])?)"
1471```
1472
1473This would match y,Y,yes,yeS,yEs,yES,Yes,YeS,YEs,YES.
1474
1475```
1476noexpr "^([nN][oO]?)"
1477```
1478
1479This would match n,N,no,nO,No,NO.
1480
1481## <a name="Reference_Elements" href="#Reference_Elements">Reference Element</a>
1482
1483(Use only in supplemental data; deprecated for ldml.dtd and locale data)
1484
1485```xml
1486<!ELEMENT references ( reference* ) >
1487<!ELEMENT reference ( #PCDATA ) >
1488<!ATTLIST reference type NMTOKEN #REQUIRED>
1489<!ATTLIST reference standard ( true | false ) #IMPLIED >
1490<!ATTLIST reference uri CDATA #IMPLIED >
1491```
1492
1493The references section supplies a central location for specifying references and standards. The uri should be supplied if at all possible. If not online, then an ISBN number should be supplied, such as in the following example:
1494
1495```xml
1496<reference type="R2" uri="https://www.ur.se/nyhetsjournalistik/3lan.html">Landskoder på Internet</reference>
1497<reference type="R3" uri="URN:ISBN:91-47-04974-X">Svenska skrivregler</reference>
1498```
1499
1500## <a name="Segmentations" href="#Segmentations">Segmentations</a>
1501
1502```xml
1503<!ELEMENT segmentations ( alias | segmentation*) >
1504
1505<!ELEMENT segmentation ( alias | (variables?, segmentRules? , exceptions?, suppressions?) | special*) >
1506<!ATTLIST segmentation type NMTOKEN #REQUIRED >
1507
1508<!ELEMENT variables ( alias | variable*) >
1509
1510<!ELEMENT variable ( #PCDATA ) >
1511<!ATTLIST variable id CDATA #REQUIRED >
1512
1513<!ELEMENT segmentRules ( alias | rule*) >
1514
1515<!ELEMENT rule ( #PCDATA ) >
1516<!ATTLIST rule id NMTOKEN #REQUIRED >
1517
1518<!ELEMENT suppressions ( suppression* ) >
1519
1520<!ATTLIST suppressions type NMTOKEN "standard" >
1521
1522<!ATTLIST suppressions draft ( approved | contributed | provisional | unconfirmed ) #IMPLIED >
1523
1524<!ELEMENT suppression ( #PCDATA ) >
1525```
1526
1527The `segmentations` element provides for segmentation of text into words, lines, or other segments. The structure is based on [[UAX29](https://www.unicode.org/reports/tr41/#UAX29)] notation, but adapted to be machine-readable. It uses a list of variables (representing character classes) and a list of rules. Each must have an `id` attribute.
1528
1529The rules in _root_ implement the segmentations found in [[UAX29](https://www.unicode.org/reports/tr41/#UAX29)] and
1530[[UAX14](https://www.unicode.org/reports/tr41/#UAX14)], for grapheme clusters, words, sentences, and lines. They can be
1531overridden by rules in child locales. In addition, there are several locale keywords that affect segmentation:
1532
1533* "dx", [Unicode Dictionary Break Exclusion Identifier](tr35.md#UnicodeDictionaryBreakExclusionIdentifier)
1534* "lb", [Unicode Line Break Style Identifier](tr35.md#UnicodeLineBreakStyleIdentifier)
1535* "lw", [Unicode Line Break Word Identifier ](tr35.md#UnicodeLineBreakWordIdentifier)
1536* "ss", [Unicode Sentence Break Suppressions Identifier ](tr35.md#UnicodeSentenceBreakSuppressionsIdentifier)
1537
1538Here is an example:
1539
1540```xml
1541<segmentations>
1542  <segmentation type="GraphemeClusterBreak">
1543    <variables>
1544      <variable id="$CR">\p{Grapheme_Cluster_Break=CR}</variable>
1545      <variable id="$LF">\p{Grapheme_Cluster_Break=LF}</variable>
1546      <variable id="$Control">\p{Grapheme_Cluster_Break=Control}</variable>
1547      <variable id="$Extend">\p{Grapheme_Cluster_Break=Extend}</variable>
1548      <variable id="$L">\p{Grapheme_Cluster_Break=L}</variable>
1549      <variable id="$V">\p{Grapheme_Cluster_Break=V}</variable>
1550      <variable id="$T">\p{Grapheme_Cluster_Break=T}</variable>
1551      <variable id="$LV">\p{Grapheme_Cluster_Break=LV}</variable>
1552      <variable id="$LVT">\p{Grapheme_Cluster_Break=LVT}</variable>
1553    </variables>
1554    <segmentRules>
1555      <rule id="3"> $CR × $LF </rule>
1556      <rule id="4"> ( $Control | $CR | $LF ) ÷ </rule>
1557      <rule id="5"> ÷ ( $Control | $CR | $LF ) </rule>
1558      <rule id="6"> $L × ( $L | $V | $LV | $LVT ) </rule>
1559      <rule id="7"> ( $LV | $V ) × ( $V | $T ) </rule>
1560      <rule id="8"> ( $LVT | $T) × $T </rule>
1561      <rule id="9"> × $Extend </rule>
1562    </segmentRules>
1563  </segmentation>
1564...
1565```
1566
1567**Variables:** All variable ids must start with a $, and otherwise be valid identifiers according to the Unicode definitions in [[UAX31](https://www.unicode.org/reports/tr41/#UAX31)]. The contents of a variable is a regular expression using variables and [UnicodeSet](tr35.md#Unicode_Sets)s. The ordering of variables is important; they are evaluated in order from first to last (see _[Segmentation Inheritance](#Segmentation_Inheritance)_). It is an error to use a variable before it is defined.
1568
1569**Rules:** The contents of a rule uses the syntax of [[UAX29](https://www.unicode.org/reports/tr41/#UAX29)]. The rules are evaluated in numeric id order (which may not be the order in which they appear in the file). The first rule that matches determines the status of a boundary position, that is, whether it breaks or not. Thus ÷ means a break is allowed; × means a break is forbidden. It is an error if the rule does not contain exactly one of these characters (except where a rule has no contents at all, or if the rule uses a variable that has not been defined.
1570
1571There are some implicit rules:
1572
1573*   The implicit initial rules are always "start-of-text ÷" and "÷ end-of-text"; these are not to be included explicitly.
1574*   The implicit final rule is always "Any ÷ Any". This is not to be included explicitly.
1575
1576> **Note:** A rule like X Format\* -> X in [[UAX29](https://www.unicode.org/reports/tr41/#UAX29)] and [[UAX14](https://www.unicode.org/reports/tr41/#UAX14)] is not supported. Instead, this needs to be expressed as normal regular expressions. The normal way to support this is to modify the variables, such as in the following example:
1577>
1578> ```xml
1579> <variable id="$Format">\p{Word_Break=Format}</variable>
1580> <variable id="$Katakana">\p{Word_Break=Katakana}</variable>
1581> ...
1582> <!-- In place of rule 3, add format and extend to everything -->
1583> <variable id="$X">[$Format $Extend]*</variable>
1584> <variable id="$Katakana">($Katakana $X)</variable>
1585> <variable id="$ALetter">($ALetter $X)</variable>
1586> ...
1587> ```
1588
1589### <a name="Segmentation_Inheritance" href="#Segmentation_Inheritance">Segmentation Inheritance</a>
1590
1591Variables and rules both inherit from the parent.
1592
1593**Variables:** The child's variable list is logically appended to the parent's, and evaluated in that order. For example:
1594
1595```xml
1596// in parent
1597<variable id="$AL">[:linebreak=AL:]</variable>
1598<variable id="$YY">[[:linebreak=XX:]$AL]</variable> // adds $AL
1599
1600// in child
1601<variable id="$AL">[$AL && [^a-z]]</variable> // changes $AL, does not affect $YY
1602<variable id="$ABC">[abc]</variable> // adds new rule
1603```
1604
1605**Rules:** The rules are also logically appended to the parent's. Because rules are evaluated in numeric id order, to insert a rule in between others just requires using an intermediate number. For example, to insert a rule after id="10.1" and before id="10.2", just use id="10.15". To delete a rule, use empty contents, such as:
1606
1607```xml
1608<rule id="3" /> // deletes rule 3
1609````
1610
1611### <a name="Segmentation_Exceptions" href="#Segmentation_Exceptions">Segmentation Suppressions</a>
1612
1613**Note:** As of CLDR 26, the `<suppressions>` data is to be considered a technology preview. Data currently in CLDR was extracted from the Unicode Localization Interoperability project, or ULI. The ULI committee has been disbanded, but historical information can be found at <https://www.unicode.org/uli/>.
1614
1615The segmentation **suppressions** list provides a set of cases which, though otherwise identified as a segment by rules, should be skipped (suppressed) during segmentation.
1616
1617For example, in the English phrase "Mr. Smith", CLDR segmentation rules would normally find a Sentence Break between "Mr" and "Smith". However, typically, "Mr." is just an abbreviation for "Mister", and not actually the end of a sentence.
1618
1619Each suppression has a separate `<suppression>` element, whose contents are the break to be skipped.
1620
1621Example:
1622
1623```xml
1624<segmentation type="SentenceBreak">
1625    <suppressions type="standard" draft="provisional">
1626        <suppression>Maj.</suppression>
1627        <suppression>Mr.</suppression>
1628        <suppression>Lt.Cdr.</suppression>
1629        . . .
1630    </suppressions>
1631</segmentation>
1632```
1633
1634**Note:** These elements were called `<exceptions>` and `<exception>` prior to CLDR 26, but those names are now deprecated.
1635
1636## <a name="Transforms" href="#Transforms">Transforms</a>
1637
1638Transforms provide a set of rules for transforming text via a specialized set of context-sensitive matching rules. They are commonly used for transliterations or transcriptions, but also other transformations such as full-width to half-width (for _katakana_ characters). The rules can be simple one-to-one relationships between characters, or involve more complicated mappings. Here is an example:
1639
1640```xml
1641<transform source="Greek" target="Latin" variant="UNGEGN" direction="both">
1642    ...
1643    <comment>Useful variables</comment>
1644    <tRule>$gammaLike = [ΓΚΞΧγκξχϰ] ;</tRule>
1645    <tRule>$egammaLike = [GKXCgkxc] ;</tRule>
1646    ...
1647    <comment>Rules are predicated on running NFD first, and NFC afterwards</comment>
1648    <tRule>::NFD (NFC) ;</tRule>
1649    ...
1650    <tRule>λ ↔ l ;</tRule>
1651    <tRule>Λ ↔ L ;</tRule>
1652    ...
1653    <tRule>γ } $gammaLike ↔ n } $egammaLike ;</tRule>
1654    <tRule>γ ↔ g ;</tRule>
1655    ...
1656    <tRule>::NFC (NFD) ;</tRule>
1657    ...
1658</transform>
1659```
1660
1661The source and target values are valid locale identifiers, where 'und' means an unspecified language, plus some additional extensions.
1662
1663* The long names of a script according to [[UAX24](https://www.unicode.org/reports/tr41/#UAX24)] may be used instead of the short script codes. The script identifier may also omit und; that is, "und_Latn" may be written as just "Latn".
1664* The long names of the English languages may also be used instead of the languages.
1665* The term "Any" may be used instead of a solitary "und".
1666* Other identifiers may be used for special purposes. In CLDR, these include: Accents, Digit, Fullwidth, Halfwidth, Jamo, NumericPinyin, Pinyin, Publishing, Tone. (Other than these values, valid private use locale identifiers should be used, such as "x-Special".)
1667* When presenting localizing transform names, the "und\_" is normally omitted. Thus for a transliterator with the ID "und_Latn-und_Grek" (or the equivalent "Latin-Greek"), the translated name for Greek would be Λατινικό-Ελληνικό.
1668
1669In version 29.0, BCP47 identifiers were added as aliases (while retaining the old identifiers). The following table shows the relationship between the old identifiers and the BCP47 format identifiers.
1670
1671<!-- HTML: rowspan -->
1672
1673<table><tbody>
1674<tr>
1675    <th>Old ID</th>
1676    <th>BCP47 ID</th>
1677    <th>Comments</th>
1678</tr>
1679<tr>
1680    <td><b>es_FONIPA</b>-es_419_FONIPA</td>
1681    <td>es-419-fonipa-t-<b>es-fonipa</b></td>
1682    <td rowspan="2">The order reverses with -t-. That is, the language subtag part is what results.</td>
1683</tr>
1684<tr>
1685    <td><b>hy_AREVMDA</b>-hy_AREVMDA_FONIPA</td>
1686    <td>hy-arevmda-fonipa-t-<b>hy-arevmda</b></td>
1687</tr>
1688<tr>
1689    <td><b>Devanagari</b>-Latin</td>
1690    <td>und-Latn-t-<b>und-deva</b></td>
1691    <td rowspan="2">Scripts add <b>und-</b></td>
1692</tr>
1693<tr>
1694    <td><b>Latin</b>-Devanagari</td>
1695    <td>und-Deva-t-<b>und-latn</b></td>
1696</tr>
1697<tr>
1698    <td>Greek-Latin/UNGEGN</td>
1699    <td>und-Latn-t-und-grek-<b>m0-ungegn</b></td>
1700    <td>Variants use the <b>-m0-</b> key.</td>
1701</tr>
1702<tr>
1703    <td>Russian-Latin/BGN</td>
1704    <td>ru<b>-Latn</b>-t-ru-m0-bgn</td>
1705    <td>Languages will have a script when it isn’t the default.</td>
1706</tr>
1707<tr>
1708    <td>Any-Hex/xml</td>
1709    <td>und-t-<b>d0-hex</b>-m0-xml</td>
1710    <td rowspan="2"><b>Any</b> becomes <b>und</b>, and keys <b>d0</b> (destination) and <b>s0</b> (source) are used for non-locales.</td>
1711</tr>
1712<tr>
1713    <td>Hex-Any/xml</td>
1714    <td>und-t-<b>s0-hex</b>-m0-xml</td>
1715</tr>
1716<tr>
1717    <td>Any-<b>Publishing</b></td>
1718    <td>und-t-d0-<b>publish</b></td>
1719    <td rowspan="2">Non-locales are normally the lowercases of the old ID, but may change because of BCP47 length restrictions.</td>
1720</tr>
1721<tr>
1722    <td><b>Publishing</b>-Any</td>
1723    <td>und-t-s0-<b>publish</b></td>
1724</tr>
1725</tbody></table>
1726
1727Note that the script and region codes are cased iff they are in the main subtag, but are lowercase in extensions.
1728
1729### <a name="Inheritance" href="#Inheritance">Inheritance</a>
1730
1731The CLDR transforms are built using the following locale inheritance. While this inheritance is not required of LDML implementations, the transforms supplied with CLDR may not otherwise behave as expected without some changes.
1732
1733For either the source or the target, the fallback starts from the maximized locale ID (using the likely-subtags data). It also uses the country for lookup before the base language is reached, and root is never accessed: instead the script(s) associated with the language are used. Where there are multiple scripts, the maximized script is tried first, and then the other scripts associated with the language (from supplemental data).
1734
1735For example, see the bolded items below in the fallback chain for **az_IR**.
1736
1737|     | Locale ID      | Comments                       |
1738| --- | -------------- | ------------------------------ |
1739|  1  | **az_Arab_IR** | The maximized locale for az_IR |
1740|  2  | az_Arab        | Normal fallback                |
1741|  3  | **az_IR**      | Inserted country locale        |
1742|  4  | az             | Normal fallback                |
1743|  5  | **Arab**       | Maximized script               |
1744|  6  | **Cyrl**       | Other associated script        |
1745
1746The source, target, and variant use "laddered" fallback, where the source changes the most quickly (using the above rules), then the target (using the above rules), then the variant if any, is discarded. That is, in pseudo code:
1747
1748* for variant in {variant, ""}
1749  * for target in target-chain
1750    * for source in source-chain
1751      * transform = lookup source-target/variant
1752      * if transform != null return transform
1753
1754For example, here is the fallback chain for **ru_RU-el_GR/BGN**.
1755
1756| source |     | target | variant |
1757| ------ | --- | ------ | ------- |
1758| ru_RU  | -   | el_GR  | /BGN    |
1759| ru     | -   | el_GR  | /BGN    |
1760| Cyrl   | -   | el_GR  | /BGN    |
1761| ru_RU  | -   | el     | /BGN    |
1762| ru     | -   | el     | /BGN    |
1763| Cyrl   | -   | el     | /BGN    |
1764| ru_RU  | -   | Grek   | /BGN    |
1765| ru     | -   | Grek   | /BGN    |
1766| Cyrl   | -   | Grek   | /BGN    |
1767| ru_RU  | -   | el_GR  |         |
1768| ru     | -   | el_GR  |         |
1769| Cyrl   | -   | el_GR  |         |
1770| ru_RU  | -   | el     |         |
1771| ru     | -   | el     |         |
1772| Cyrl   | -   | el     |         |
1773| ru_RU  | -   | Grek   |         |
1774| ru     | -   | Grek   |         |
1775| Cyrl   | -   | Grek   |         |
1776
1777Japanese and Korean are special, since they can be represented by combined script codes, such as ja_Jpan, ja_Hrkt, ja_Hira, or ja_Kana. These need to be considered in the above fallback chain as well.
1778
1779#### <a name="Pivots" href="#Pivots">Pivots</a>
1780
1781Transforms can also use _pivots_. These are used when there is no direct transform between a source and target, but there are transforms X-Y and Y-Z. In such a case, the transforms can be internally chained to get X-Y = X-Y;Y-Z. This is done explicitly with the Indic script transforms: to get Devanagari-Latin, internally it is done by transforming first from Devanagari to Interindic (an internal superset encoding for Indic scripts), then from Interindic to Latin. This allows there to be only N sets of transform rules for the Indic scripts: each one to and from Interindic. These pivots are explicitly represented in the CLDR transforms.
1782
1783Note that the characters currently used by Interindic are private use characters. To prevent those from “leaking” out into text, transforms converting from Interindic must ensure that they convert all the possible values used in Interindic.
1784
1785The pivots can also be produced automatically (implicitly), as a fallback. A particularly useful pivot is IPA, since that tends to preserve pronunciation. For example, _Czech to IPA_ can be chained with _IPA to Katakana_ to get _Czech to Katakana_.
1786
1787CLDR often has special forms of IPA: not just "und-FONIPA" but "cs-FONIPA": specifically IPA that has come from Czech. These variants typically preserve some features of the source language — such as double consonants — that are indistinguishable from single consonants in that language, but that are often preserved in traditional transliterations. Thus when matching prospective pivots, FONIPA is treated specially. If there is an exact match, that match is used (such as cs-cs_FONIPA + cs_FONIPA-ko). Otherwise, the language is ignored, as for example in cs-cs_FONIPA + ru_FONIPA-ko.
1788
1789The interaction of implicit pivots and inheritance may result in a longer inheritance chain lookup than desired, so implementers may consider having some sort of caching mechanism to increase performance.
1790
1791### <a name="Variants" href="#Variants">Variants</a>
1792
1793Variants used in CLDR include UNGEGN and BGN, both indicating sources for transliterations. There is an additional attribute `private="true"` which is used to indicate that the transform is meant for internal use, and should not be displayed as a separate choice in a UI.
1794
1795There are many different systems of transliteration. The goal for the "unqualified" script transliterations are
1796
17971. to be lossless when going to Latin and back
17982. to be as lossless as possible when going to other scripts
17993. to abide by a common standard as much as possible (possibly supplemented to meet goals 1 and 2).
1800
1801Language-to-language transliterations, and variant script-to-script transliterations are generally transcriptions, and not expected to be lossless.
1802
1803Additional transliterations may also be defined, such as customized language-specific transliterations (such as between Russian and French), or those that match a particular transliteration standard, such as the following:
1804
1805* UNGEGN - United Nations Group of Experts on Geographical Names
1806* BGN - United States Board on Geographic Names
1807* ISO9 - ISO/IEC 9
1808* ISO15915 - ISO/IEC 15915
1809* ISCII91 - ISCII 91
1810* KMOCT - South Korean Ministry of Culture & Tourism
1811* USLC - US Library of Congress
1812* UKPCGN - Permanent Committee on Geographical Names for British Official Use
1813* RUGOST - Russian Main Administration of Geodesy and Cartography
1814
1815The rules for transforms are described in [Transform Rules Syntax](#Transform_Rules_Syntax). For more information on Transliteration, see [Transliteration Guidelines](https://cldr.unicode.org/index/cldr-spec/transliteration-guidelines).
1816
1817### <a name="Transform_Rules_Syntax" href="#Transform_Rules_Syntax">Transform Rules Syntax</a>
1818
1819```xml
1820<!ELEMENT transforms ( transform*) >
1821<!ELEMENT transform ((comment | tRule)*) >
1822<!ATTLIST transform source CDATA #IMPLIED >
1823<!ATTLIST transform target CDATA #IMPLIED >
1824<!ATTLIST transform variant CDATA #IMPLIED >
1825<!ATTLIST transform direction ( forward | backward | both ) "both" >
1826<!ATTLIST transform alias CDATA #IMPLIED >
1827<!--@VALUE-->
1828<!ATTLIST transform backwardAlias CDATA #IMPLIED >
1829<!--@VALUE-->
1830<!ATTLIST transform visibility ( internal | external ) "external" >
1831<!ELEMENT comment (#PCDATA) >
1832<!ELEMENT tRule (#PCDATA) >
1833```
1834
1835The `transform` attributes indicate the `source`, `target`, `direction`, and `alias`es. For example:
1836
1837```xml
1838<transform
1839  source="ja_Hrkt"
1840  target="ja_Latn"
1841  variant="BGN"
1842  direction="forward"
1843  draft="provisional"
1844  alias="Katakana-Latin/BGN ja-Latn-t-ja-hrkt-m0-bgn">
1845```
1846
1847The direction is either `forward` or `both` (`backward` is possible in theory, but not used). This indicates which directions the rules support.
1848
1849If the direction is `forward`, then an ID is composed from `target + "-" + source + "/" + variant`. If the direction is `both`, then the inverse ID is also value: `source + "-" + target + "/" + variant`. The `alias` attribute contains a space-delimited list of alternant forward IDs, while the `backwardAlias` contains a space-delimited list of alternant backward IDs. The BCP47 versions of the IDs will be in the `alias` and/or `backwardAlias` attributes.
1850
1851The `visibility` attribute indicates whether the IDs should be externally visible, or whether they are only used internally.
1852
1853Note: In CLDR v28 and before, the rules were expressed as fine-grained XML.
1854That was discarded in CLDR version 29, in favor of a simpler format where the separate rules are simply terminated with ";".
1855
1856The transform rules are similar to regular-expression substitutions, but adapted to the specific domain of text transformations. The rules and comments in this discussion will be intermixed, with # marking the comments. The simplest rule is a conversion rule, which replaces one string of characters with another. The conversion rule takes the following form:
1857
1858```
1859xy → z ;
1860```
1861
1862This converts any substring "xy" into "z". Rules are executed in order; consider the following rules:
1863
1864```
1865sch → sh ;
1866ss → z ;
1867```
1868
1869This conversion rule transforms "bass school" into "baz shool". The transform walks through the string from start to finish. Thus given the rules above "bassch" will convert to "bazch", because the "ss" rule is found before the "sch" rule in the string (later, we'll see a way to override this behavior). If two rules can both apply at a given point in the string, then the transform applies the first rule in the list.
1870
1871All of the ASCII characters except numbers and letters are reserved for use in the rule syntax, as are the characters `→`, `←`, `↔`. Normally, these characters do not need to be converted. However, to convert them use either a pair of single quotes or a slash. The pair of single quotes can be used to surround a whole string of text. The slash affects only the character immediately after it. For example, to convert from a U+2190 ( ← ) LEFTWARDS ARROW to the string "arrow sign" (with a space), use one of the following rules:
1872
1873```
1874\←    → arrow\ sign ;
1875'←'   → 'arrow sign' ;
1876'←'   → arrow' 'sign ;
1877```
1878
1879Note: The characters `→`, `←`, `↔` are preferred, but can be represented by the ASCII character `>`, `<`, and `<>`, respectively.
1880
1881Spaces may be inserted anywhere without any effect on the rules. Use extra space to separate items out for clarity without worrying about the effects. This feature is particularly useful with combining marks; it is handy to put some spaces around it to separate it from the surrounding text. The following is an example:
1882
1883```
1884→ i ; # an iota-subscript diacritic turns into an i.
1885```
1886
1887For a real space in the rules, place quotes around it. For a real backslash, either double it \\\\, or quote it '\\'. For a real single quote, double it '', or place a backslash before it \\'.
1888
1889Any text that starts with a hash mark and concludes a line is a comment. Comments help document how the rules work. The following shows a comment in a rule:
1890
1891```
1892x → ks ; # change every x into ks
1893```
1894
1895The “\\u” and “\\x” hex notations can be used instead of any letter. For instance, instead of using the Greek π, one could write either of the following:
1896
1897```
1898\u03C0 → p ;
1899\x{3C0} → p ;
1900```
1901
1902One can also define and use variables, such as:
1903
1904```
1905$pi = \u03C0 ;
1906$pi → p ;
1907```
1908
1909#### <a name="Dual_Rules" href="#Dual_Rules">Dual Rules</a>
1910
1911Rules can also specify what happens when an inverse transform is formed. To do this, we reverse the direction of the "←" sign. Thus the above example becomes:
1912
1913```
1914$pi ← p ;
1915```
1916
1917With the inverse transform, "p" will convert to the Greek p. These two directions can be combined together into a dual conversion rule by using the `↔` operator, yielding:
1918
1919```
1920$pi ↔ p ;
1921```
1922
1923#### <a name="Context" href="#Context">Context</a>
1924
1925Context can be used to have the results of a transformation be different depending on the characters before or after. The following rule removes hyphens, but only when they follow lowercase characters:
1926
1927```
1928[:Lowercase:] { '-' → ;
1929```
1930
1931Contexts can be before or after or both, such as in a rule to remove hyphens between lowercase and uppercase letters:
1932
1933```
1934[:Lowercase:] { '-' } [:Uppercase:] → ;
1935```
1936
1937Each context is optional and may be empty; the following two rules are equivalent:
1938
1939```
1940$pi ↔ p ;
1941{$pi} ↔ {p} ;
1942```
1943
1944The context itself ([: `Lowercase` :]) is unaffected by the replacement; only the text within braces is changed.
1945
1946Character classes (UnicodeSets) in the contexts can contain the special symbol $, which means “off either end of the string”. It is roughly similar to $ and ^ in regex. Unlike normal regex, however, it can occur in character classes. Thus the following rule removes hyphens that are after lowercase characters, _or_ are at the start of a string.
1947
1948```
1949[[:Lowercase:]$] {'-' → ;
1950```
1951
1952Thus the negation of a UnicodeSet will normally also match before or after the end of a string. The following will remove hyphens that are not after lowercase characters, _including hyphens at the start of a string_.
1953
1954```
1955[^[:Lowercase:]] {'-' → ;
1956```
1957
1958It will thus convert “-B A-B a-b” to “B AB a-b”.
1959
1960#### <a name="Revisiting" href="#Revisiting">Revisiting</a>
1961
1962If the resulting text contains a vertical bar "|", then that means that processing will proceed from that point and that the transform will revisit part of the resulting text.
1963Thus the | marks a "cursor" position.
1964For example, if we have the following, then the string "xa" will convert to "yw".
1965
1966```
1967x → y | z ;
1968z a → w ;
1969```
1970
1971First, "xa" is converted to "yza". Then the processing will continue from after the character "y", pick up the "za", and convert it. Had we not had the "|", the result would have been simply "yza".
1972
1973The '@' character can be used as filler character to place the revisiting point off the start or end of the string — but only within the context. Consider the following rules, with the table afterwards showing how they work.
1974
1975```
19761. [a-z]{x > |@ab ;
19772. ab > J;
19783. ca > M;
1979```
1980The ⸠ indicates the virtual cursor:
1981
1982| Current text | Matching rule |
1983| - | - |
1984| ⸠cx | no match, cursor advances one code point |
1985| c⸠x | matches rule 1, so the text is replaced and cursor backs up. |
1986| ⸠cab | matches rule 3, so the text is replaced, with cursor at the end. |
1987| Mb⸠ | cursor is at the end, so we are done. |
1988
1989Notice that rule 2 did not have a chance to trigger.
1990
1991There is a current restriction that @ cannot back up before the before_context or after the after_context.
1992Consider the rules if rule 1 is adjusted to have no before_context.
1993
1994```
19951'. x > |@ab ;
19962. ab > J ;
19973. ca > M;
1998```
1999
2000In that case, the results are different.
2001| Current text | Matching rule |
2002| - | - |
2003| ⸠cx | no match, cursor advances one code point |
2004| c⸠x | matches rule 1, so the text is replaced and cursor backs up; but only to where  |
2005| c⸠ab | matches **rule 2**, so the text is replaced, with cursor at the end. |
2006| cJ⸠ | cursor is at the end, so we are done. |
2007
2008#### <a name="Example" href="#Example">Example</a>
2009
2010The following shows how these features are combined together in the Transliterator "Any-Publishing". This transform converts the ASCII typewriter conventions into text more suitable for desktop publishing (in English). It turns straight quotation marks or UNIX style quotation marks into curly quotation marks, fixes multiple spaces, and converts double-hyphens into a dash.
2011
2012```perl
2013# Variables
2014
2015$single = \' ;
2016$space = ' ' ;
2017$double = \" ;
2018$back = \` ;
2019$tab = '\u0008' ;
2020
2021# the following is for spaces, line ends, (, [, {, ...
2022$makeRight = [[:separator:][:start punctuation:][:initial punctuation:]] ;
2023
2024# fix UNIX quotes
2025
2026$back $back → “ ; # generate right d.q.m. (double quotation mark)
2027$back → ‘ ;
2028
2029# fix typewriter quotes, by context
2030
2031$makeRight { $double ↔ “ ; # convert a double to right d.q.m. after certain chars
2032^ { $double → “ ; # convert a double at the start of the line.
2033$double ↔ ” ; # otherwise convert to a left q.m.
2034
2035$makeRight {$single} ↔ ‘ ; # do the same for s.q.m.s
2036^ {$single} → ‘ ;
2037$single ↔ ’;
2038
2039# fix multiple spaces and hyphens
2040
2041$space {$space} → ; # collapse multiple spaces
2042'--' ↔ — ; # convert fake dash into real one
2043```
2044
2045There is an online demo where the rules can be tested, at:
2046
2047<https://util.unicode.org/UnicodeJsps/transform.jsp>
2048
2049#### <a name="Rule_Syntax" href="#Rule_Syntax">Rule Syntax</a>
2050
2051The following describes the full format of the list of rules used to create a transform. Each rule in the list is terminated by a semicolon. The list consists of the following:
2052
2053* an optional filter rule
2054* zero or more transform rules
2055* zero or more variable-definition rules
2056* zero or more conversion rules
2057* an optional inverse filter rule
2058
2059The filter rule, if present, must appear at the beginning of the list, before any of the other rules.  The inverse filter rule, if present, must appear at the end of the list, after all of the other rules.  The other rules may occur in any order and be freely intermixed.
2060
2061The rule list can also generate the inverse of the transform. In that case, the inverse of each of the rules is used, as described below.
2062
2063#### <a name="Transform_Rules" href="#Transform_Rules">Transform Rules</a>
2064
2065Each transform rule consists of two colons followed by a transform name, which is of the form source-target. For example:
2066
2067```
2068:: NFD ;
2069:: und_Latn-und_Greek ;
2070:: Latin-Greek; # alternate form
2071```
2072
2073If either the source or target is 'und', it can be omitted, thus 'und_NFC' is equivalent to 'NFC'. For compatibility, the English names for scripts can be used instead of the und_Latn locale name, and "Any" can be used instead of "und". Case is not significant.
2074
2075The following transforms are defined not by rules, but by the operations in the Unicode Standard, and may be used in building any other transform:
2076
2077> **Any-NFC, Any-NFD, Any-NFKD, Any-NFKC** - the normalization forms defined by [[UAX15](https://www.unicode.org/reports/tr41/#UAX15)].
2078>
2079> **Any-Lower, Any-Upper, Any-Title** - full case transformations, defined by [[Unicode](tr35.md#Unicode)] Chapter 3.
2080
2081In addition, the following special cases are defined:
2082
2083> **Any-Null** - has no effect; that is, each character is left alone.
2084> **Any-Remove** - maps each character to the empty string; this, removes each character.
2085
2086The inverse of a transform rule uses parentheses to indicate what should be done when the inverse transform is used. For example:
2087
2088```
2089:: lower () ; # only executed for the normal
2090:: (lower) ; # only executed for the inverse
2091:: lower ; # executed for both the normal and the inverse
2092```
2093
2094#### <a name="Variable_Definition_Rules" href="#Variable_Definition_Rules">Variable Definition Rules</a>
2095
2096Each variable definition is of the following form:
2097
2098```
2099$variableName = contents ;
2100```
2101
2102The variable name can contain letters and digits, but must start with a letter. More precisely, the variable names use Unicode identifiers as defined by [[UAX31](https://www.unicode.org/reports/tr41/#UAX31)]. The identifier properties allow for the use of foreign letters and numbers.
2103
2104The contents of a variable definition is any sequence of Unicode sets and characters or characters. For example:
2105
2106```
2107$mac = M [aA] [cC] ;
2108```
2109
2110Variables are only replaced within other variable definition rules and within conversion rules. They have no effect on transliteration rules.
2111
2112#### <a name="Filter_Rules" href="#Filter_Rules">Filter Rules</a>
2113
2114A filter rule consists of two colons followed by a UnicodeSet. This filter is global in that only the characters matching the filter will be affected by any transform rules or conversion rules. The inverse filter rule consists of two colons followed by a UnicodeSet in parentheses. This filter is also global for the inverse transform.
2115
2116For example, the Hiragana-Latin transform can be implemented by "pivoting" through the Katakana converter, as follows:
2117
2118```
2119:: [:^Katakana:] ; # do not touch any katakana that was in the text!
2120:: Hiragana-Katakana;
2121:: Katakana-Latin;
2122:: ([:^Katakana:]) ; # do not touch any katakana that was in the text
2123                     # for the inverse either!
2124```
2125
2126The filters keep the transform from mistakenly converting any of the "pivot" characters. Note that this is a case where a rule list contains no conversion rules at all, just transform rules and filters.
2127
2128#### <a name="Conversion_Rules" href="#Conversion_Rules">Conversion Rules</a>
2129
2130Conversion rules can be forward, backward, or double. The complete conversion rule syntax is described below:
2131
2132**Forward**
2133
2134> A forward conversion rule is of the following form:
2135> ```
2136> before_context { text_to_replace } after_context → completed_result | result_to_revisit ;
2137> ```
2138> If there is no before_context, then the "{" can be omitted. If there is no after_context, then the "}" can be omitted. If there is no result_to_revisit, then the "|" can be omitted. A forward conversion rule is only executed for the normal transform and is ignored when generating the inverse transform.
2139
2140**Backward**
2141
2142> A backward conversion rule is of the following form:
2143> ```
2144> completed_result | result_to_revisit ← before_context { text_to_replace } after_context ;
2145> ```
2146> The same omission rules apply as in the case of forward conversion rules. A backward conversion rule is only executed for the inverse transform and is ignored when generating the normal transform.
2147
2148**Dual**
2149
2150> A dual conversion rule combines a forward conversion rule and a backward conversion rule into one, as discussed above. It is of the form:
2151>
2152> ```
2153> a { b | c } d ↔ e { f | g } h ;
2154> ```
2155>
2156> When generating the normal transform and the inverse, the revisit mark "|" and the before and after contexts are ignored on the sides where they do not belong. Thus, the above is exactly equivalent to the sequence of the following two rules:
2157>
2158> ```
2159> a { b c } d → f | g  ;
2160> b | c  ←  e { f g } h ;
2161> ```
2162
2163The `completed_result` | `result_to_revisit` is also known as the `resulting_text`. Either or both of the values can be empty. For example, the following removes any a, b, or c.
2164
2165```
2166[a-c] → ;
2167```
2168
2169#### <a name="Intermixing_Transform_Rules_and_Conversion_Rules" href="#Intermixing_Transform_Rules_and_Conversion_Rules">Intermixing Transform Rules and Conversion Rules</a>
2170
2171Transform rules and conversion rules may be freely intermixed. Inserting a transform rule into the middle of a set of conversion rules has an important side effect.
2172
2173Normally, conversion rules are considered together as a group.  The only time their order in the rule set is important is when more than one rule matches at the same point in the string.  In that case, the one that occurs earlier in the rule set wins.  In all other situations, when multiple rules match overlapping parts of the string, the one that matches earlier wins.
2174
2175Transform rules apply to the whole string.  If you have several transform rules in a row, the first one is applied to the whole string, then the second one is applied to the whole string, and so on.  To reconcile this behavior with the behavior of conversion rules, transform rules have the side effect of breaking a surrounding set of conversion rules into two groups: First all of the conversion rules before the transform rule are applied as a group to the whole string in the usual way, then the transform rule is applied to the whole string, and then the conversion rules after the transform rule are applied as a group to the whole string.  For example, consider the following rules:
2176
2177```
2178abc → xyz;
2179xyz → def;
2180::Upper;
2181```
2182
2183If you apply these rules to “abcxyz”, you get “XYZDEF”. If you move the “::Upper;” to the middle of the rule set and change the cases accordingly, then applying this to “abcxyz” produces “DEFDEF”.
2184
2185```
2186abc → xyz;
2187::Upper;
2188XYZ → DEF;
2189```
2190
2191This is because “::Upper;” causes the transliterator to reset to the beginning of the string. The first rule turns the string into “xyzxyz”, the second rule upper cases the whole thing to “XYZXYZ”, and the third rule turns this into “DEFDEF”.
2192
2193This can be useful when a transform naturally occurs in multiple “passes.”  Consider this rule set:
2194
2195```
2196[:Separator:]* → ' ';
2197'high school' → 'H.S.';
2198'middle school' → 'M.S.';
2199'elementary school' → 'E.S.';
2200```
2201
2202If you apply this rule to “high school”, you get “H.S.”, but if you apply it to “high  school” (with two spaces), you just get “high school” (with one space). To have “high school” (with two spaces) turn into “H.S.”, you'd either have to have the first rule back up some arbitrary distance (far enough to see “elementary”, if you want all the rules to work), or you have to include the whole left-hand side of the first rule in the other rules, which can make them hard to read and maintain:
2203
2204```
2205$space = [:Separator:]*;
2206high $space school → 'H.S.';
2207middle $space school → 'M.S.';
2208elementary $space school → 'E.S.';
2209```
2210
2211Instead, you can simply insert “ `::Null;` ” in order to get things to work right:
2212
2213```
2214[:Separator:]* → ' ';
2215::Null;
2216'high school' → 'H.S.';
2217'middle school' → 'M.S.';
2218'elementary school' → 'E.S.';
2219```
2220
2221The “::Null;” has no effect of its own (the null transform, by definition, does not do anything), but it splits the other rules into two “passes”: The first rule is applied to the whole string, normalizing all runs of white space into single spaces, and then we start over at the beginning of the string to look for the phrases. “high    school” (with four spaces) gets correctly converted to “H.S.”.
2222
2223This can also sometimes be useful with rules that have overlapping domains.  Consider this rule set from before:
2224
2225```
2226sch → sh ;
2227ss → z ;
2228```
2229
2230Applying this rule to “bassch” results in “bazch” because “ss” matches earlier in the string than “sch”. If you really wanted “bassh”—that is, if you wanted the first rule to win even when the second rule matches earlier in the string, you'd either have to add another rule for this special case...
2231
2232```
2233sch → sh ;
2234ssch → ssh;
2235ss → z ;
2236```
2237
2238...or you could use a transform rule to apply the conversions in two passes:
2239
2240```
2241sch → sh ;
2242::Null;
2243ss → z ;
2244```
2245
2246#### <a name="Inverse_Summary" href="#Inverse_Summary">Inverse Summary</a>
2247
2248The following table shows how the same rule list generates two different transforms, where the inverse is restated in terms of forward rules (this is a contrived example, simply to show the reordering):
2249
2250<!-- HTML: blocks in cells -->
2251<table>
2252<tr>
2253    <th>Original Rules</th>
2254    <th>Forward</th>
2255    <th>Inverse</th>
2256</tr>
2257<tr>
2258    <td><pre><code>:: [:Uppercase Letter:] ;
2259:: latin-greek ;
2260:: greek-japanese ;
2261x ↔ y ;
2262z → w ;
2263r ← m ;
2264:: upper;
2265a → b ;
2266c ↔ d ;
2267:: any-publishing ;
2268:: ([:Number:]) ;</code></pre></td>
2269    <td><pre><code>:: [:Uppercase Letter:] ;
2270:: latin-greek ;
2271:: greek-japanese ;
2272x → y ;
2273z → w ;
2274:: upper ;
2275a → b ;
2276c → d ;
2277:: any-publishing ;</code></pre></td>
2278    <td><pre><code>:: [:Number:] ;
2279:: publishing-any ;
2280d → c ;
2281:: lower ;
2282y → x ;
2283m → r ;
2284:: japanese-greek ;
2285:: greek-latin ;</code></pre></td>
2286</tr>
2287</table>
2288
2289Note how the irrelevant rules (the inverse filter rule and the rules containing ←) are omitted (ignored, actually) in the forward direction, and notice how things are reversed: the transform rules are inverted and happen in the opposite order, and the groups of conversion rules are also executed in the opposite relative order (although the rules within each group are executed in the same order).
2290
2291Because the order of rules matters, the following will not work as expected
2292```
2293c → s;
2294ch → kh;
2295```
2296The second rule can never execute, because it is "masked" by the first.
2297To help prevent errors, implementations should try to alert readers when this occurs, eg:
2298```
2299Rule {c > s;} masks {ch > kh;}
2300```
2301
2302### Transform Syntax Characters
2303
2304The following summarizes the syntax characters used in transforms.
2305
2306| Character(s) | Description | Example |
2307| - | - | - |
2308| ;  | End of a conversion rule, variable definition, or transform rule invocation | a → b ; |
2309| \:\: | Invoke a transform | :: Null ; |
2310| (, ) | In a transform rule invocation, marks the backwards transform | :: Null (NFD); |
2311| $ | Mark the start of a variable, when followed by an ASCII letter | $abc |
2312| = | Used to define variables | $a = abc ; |
2313| →, \> | Transform from left to right (only for forward conversion rules) | a → b ; |
2314| ←, \< | Transform from right to left (only for backward conversion rules) | a ← b ; |
2315| ↔, \<\> | Transform from left to right (for forward) and right to left (for backward) | a ↔ b ; |
2316| { | Mark the boundary between before_context and the text_to_replace | a {b} c → B ; |
2317| } | Mark the boundary between the text_to_replace and after_context | a {b} c → B ; |
2318| ' | Escape one or more characters, until the next '  | '\<\>' → x ; |
2319| " | Escape one or more characters, until the next " | "\<\>" → x ; |
2320| \\ | Escape the next character | \\\<\\\> → x ; |
2321| # | Comment (until the end of a line) | a → ; # remove a |
2322| \| | In the resulting_text, moves the cursor | a → A \| b; |
2323| @ | In the resulting_text, filler character used to move the cursor before the start or after the end of the result | a → Ab@\|; |
2324| (, ) | In text_to_replace, a capturing group | ([a-b]) > &hex($1); |
2325| $ | In replacement_text, when followed by 1..9, is replaced by the contents of a capture group | ([a-b]) > &hex($1); |
2326| ^ | In a before_context, by itself, equivalent to [$] **(deprecated)** | ... |
2327| ? | In a before_context, after_context, or text_to_replace, a possessive quantifier for zero or one  | a?b → c ; |
2328| + | In a before_context, after_context, or text_to_replace, a possessive quantifier for one or more  | a+b → c ; |
2329| * | In a before_context, after_context, or text_to_replace, a possessive quantifier for zero or more  | a*b → c ; |
2330| & | Invoke a function in the replacement_text | ([a-b]) > &hex($1); |
2331| !, %, _, ~, -, ., / | Reserved for future syntax | ... |
2332| SPACE | Ignored except when quoted | a b # same as ab |
2333| \uXXXX | Hex notation: 4 Xs | \u0061 |
2334| \x{XX...} | Hex notation: 1-6 Xs | \x{61} |
2335| [, ] | Marks a UnicodeSet | [a-z] |
2336| \p{...} | Marks a UnicodeSet formed from a property | \p{di} |
2337| \P{...} | Marks a negative UnicodeSet formed from a property | \p{DI} |
2338| $ | Within a UnicodeSet (not before ASCII letter), matches the start or end of the source text (but is not replaced) | [$] b → c |
2339| Other | Many of these characters have special meanings inside a UnicodeSet | ... |
2340
2341## <a name="ListPatterns" href="#ListPatterns">List Patterns</a>
2342
2343```xml
2344<!ELEMENT listPatterns (alias | (listPattern*, special*)) >
2345
2346<!ELEMENT listPattern (alias | (listPatternPart*, special*)) >
2347<!ATTLIST listPattern type (NMTOKEN) #IMPLIED >
2348
2349<!ELEMENT listPatternPart ( #PCDATA ) >
2350<!ATTLIST listPatternPart type (start | middle | end | 2 | 3) #REQUIRED >
2351```
2352
2353List patterns can be used to format variable-length lists of things in a locale-sensitive manner, such as "Monday, Tuesday, Friday, and Saturday" (in English) versus "lundi, mardi, vendredi et samedi" (in French). For example, consider the following example:
2354
2355```xml
2356<listPatterns>
2357 <listPattern>
2358  <listPatternPart type="2">{0} and {1}</listPatternPart>
2359  <listPatternPart type="start">{0}, {1}</listPatternPart>
2360  <listPatternPart type="middle">{0}, {1}</listPatternPart>
2361  <listPatternPart type="end">{0}, and {1}</listPatternPart>
2362 </listPattern>
2363</listPatterns>
2364```
2365
2366Each pattern satisifies the following conditions:
2367<ul>
2368    <li>it contains the placeholders <code>{0}</code>, <code>{1}</code>, and <code>{2}</code> ("3"-pattern only) in order</li>
2369    <li>"start" and "middle" patterns end with the <code>{1}</code> placeholder</li>
2370    <li>"middle" and "end" patterns begin with the <code>{0}</code> placeholder</li>
2371</ul>
2372
2373That is,
2374<ul>
2375    <li>all patterns can have text between the placeholders</li>
2376    <li>only the "start", "2", and "3" patterns can have text before the first placeholder, and</li>
2377    <li>only the "end", "2", and "3" patterns can have text after the last placeholder.</li>
2378</ul>
2379
2380The data is used as follows: If there is a type that matches exactly the number of elements in the desired list (such as "2" in the above list), then use that pattern. Otherwise,
2381
23821.  Format the last two elements with the "end" pattern.
23832.  Then use the "middle" pattern to add on subsequent elements working towards the front, all but the very first element. That is, `{1}` is what you've already done, and `{0}` is the previous element.
23843.  Then use "start" to add the front element, again with `{1}` as what you've done so far, and `{0}` is the first element.
2385
2386Thus a list (a,b,c,...m, n) is formatted as: `start(a,middle(b,middle(c,middle(...end(m, n))...)))`. Alternatively, the list can also be processed front-to-back:
2387
23881. Format the first two elements with the "start" pattern.
23892. Then use the "middle" pattern to add on subsequent elements working towards the back, all but the very last element. That is, `{0}` is what you've already done, and `{1}` is the next element.
23903. Then use "end" to add the last element, again with `{0}` as what you've done so far, and `{1}` is the last element.
2391
2392Here, the list (a,b,c,...m, n) is formatted as:  `end(middle(..., middle(start(a, b), c) ...) m) n) `. While this prefix-expression looks less suitable, it actually only requires appends,
2393so this algorithm can be used to write into append-only sinks. Both the back-to-front and the front-to back algorithm produce this expression:
2394
2395```
2396start_before + a + start_between + b + middle_between + c + ... + middle_between + m + end_between + n + end_after
2397```
2398
2399where the patters are "start": `start_before{0}start_between{1}`, "middle": `{0}middle_between{1}`, and "end": `{0}end_between{1}end_after`.
2400
2401More sophisticated implementations can customize the process to improve the results for languages where context is important. For example:
2402
2403<!-- HTML: rowspan, block elements in cells -->
2404
2405<table><tbody>
2406<tr><td rowspan="3">Spanish</td><td>AND</td>
2407    <td>Use ‘e’ instead of ‘y’ in the listPatternPart for "end" and "2" in either of the following cases:
2408        <ol><li>The value substituted for {1} starts with ‘i’
2409                <ol><li><i>fuerte <b>e</b> indomable, </i>not <i>fuerte <b>y</b> indomable</i></li></ol>
2410            </li>
2411            <li>The value substituted for {1} starts with ‘hi’, but not with ‘hie’ or ‘hia’
2412                <ol><li><i>tos <b>e</b> hipo,</i> not <i>tos <b>y</b> hipo</i></li>
2413                    <li><i>agua <b>y</b> hielo,</i> not <i>agua <b>e</b> hielo</i></li></ol>
2414            </li></ol></td></tr>
2415
2416<tr><td>OR</td>
2417    <td>Use ‘u’ instead of ‘o’ in the listPatternPart for "end" and "2" in any of the following cases:
2418        <ol><li>The value substituted for {1} starts with ‘o’ or ‘ho’
2419                <ol><li><i>delfines <b>u</b> orcas,</i> not <i>delfines <b>o</b> orcas</i></li>
2420                    <li><i>mañana <b>u</b> hoy,</i> not <i>mañana <b>o</b> hoy</i></li></ol>
2421            </li>
2422            <li>The value substituted for {1} starts with ‘8’
2423                <ol><li><i>6 <b>u</b> 8,</i> not <i>6 <b>o</b> 8</i></li></ol>
2424            </li>
2425            <li>The value substituted for {1} starts with ‘11’ where the numeric value is 11 x 10<sup>3×y</sup> (eg 11 thousand, 11.23 million, ...)
2426                <ol><li><i>10 <b>u</b> 11,</i> not <i>10 <b>o</b> 11</i></li>
2427                    <li><i>10 <b>u</b> 11.000,</i> not <i>10 <b>o</b> 11.000</i></li>
2428                    <li><i>10 <b>o</b> 111,</i> not <i>10 <b>u</b> 111</i></li></ol>
2429            </li></ol></td></tr>
2430
2431<tr><td colspan="2">See <a href="https://www.rae.es/espanol-al-dia/cambio-de-la-y-copulativa-en-e-0">Cambio de la y copulativa en e</a><br><b>Note: </b>more advanced implementations may also consider the pronunciation, such as foreign words where the ‘h’ is not mute.</td></tr>
2432
2433<tr><td rowspan="2">Hebrew</td><td>AND</td>
2434    <td>Use ‘-ו’ instead of ‘ו’ in the listPatternPart for "end" and "2" in the following case:
2435        <ol><li>if the value substituted for {1} starts with something other than a Hebrew letter, such as a digit (0-9) or a Latin-script letter
2436            <ol><li><i>one hour and two minutes =‎ ‏"שעה ושתי דקות"‏</i></li>
2437                <li><i>one hour and 9 minutes =‎ ‏"שעה ו-9 דקות"‏</i></li></ol>
2438            </li></ol></td></tr>
2439
2440<tr><td colspan="2">See <a href="https://hebrew-academy.org.il/topic/hahlatot/punctuation/#target-3475">https://hebrew-academy.org.il/topic/hahlatot/punctuation/#target-3475</a></td></tr>
2441
2442</tbody></table>
2443
2444The following `type` attributes are in use:
2445
2446| type attribute value      | Description                                                  | Examples                         |
2447| ------------------------- | ------------------------------------------------------------ | -------------------------------- |
2448| `standard` (or no `type`) | A typical 'and' list for arbitrary placeholders              | _January, February, and March_   |
2449| `standard-short`          | A short version of an 'and' list, suitable for use with short or abbreviated placeholder values | _Jan., Feb., and Mar._ |
2450| `standard-narrow`         | A yet shorter version of a short 'and' list (where possible) | _Jan., Feb., Mar._               |
2451| `or`                      | A typical 'or' list for arbitrary placeholders               | _January, February, or March_    |
2452| `or-short`                | A short version of an 'or' list                              | _Jan., Feb., or Mar._            |
2453| `or-narrow`               | A yet shorter version of a short 'or' list (where possible)  | _Jan., Feb., or Mar._            |
2454| `unit`                    | A list suitable for wide units                               | _3 feet, 7 inches_               |
2455| `unit-short`              | A list suitable for short units                              | _3 ft, 7 in_                     |
2456| `unit-narrow`             | A list suitable for narrow units, where space on the screen is very limited. | _3′ 7″_          |
2457
2458In many languages there may not be a difference among many of these lists. In others, the spacing, the length or presence or a conjunction, and the separators may change.
2459
2460Currently there are no locale keywords that affect list patterns; they are selected using the base locale ID, ignoring anu -u- extension keywords.
2461
2462### <a name="List_Gender" href="#List_Gender">Gender of Lists</a>
2463
2464```xml
2465<!-- Gender List support -->
2466<!ELEMENT gender ( personList+ ) >
2467<!ELEMENT personList EMPTY >
2468<!ATTLIST personList type ( neutral | mixedNeutral | maleTaints ) #REQUIRED >
2469<!ATTLIST personList locales NMTOKENS #REQUIRED >
2470```
2471
2472This can be used to determine the gender of a list of 2 or more persons, such as "Tom and Mary", for use with gender-selection messages. For example,
2473
2474```xml
2475<supplementalData>
2476    <gender>
2477        <!-- neutral: gender(list) = other -->
2478        <personList type="neutral" locales="af da en..."/>
2479
2480        <!-- mixedNeutral: gender(all male) = male, gender(all female) = female, otherwise gender(list) = other -->
2481        <personList type="mixedNeutral" locales="el"/>
2482
2483        <!-- maleTaints: gender(all female) = female, otherwise gender(list) = male -->
2484        <personList type="maleTaints" locales="ar ca..."/>
2485    </gender>
2486</supplementalData>
2487```
2488
2489There are three ways the gender of a list can be formatted:
2490
24911. **neutral:** A gender-independent "other" form will be used for the list.
24922. **mixedNeutral:** If the elements of the list are all male, "male" form is used for the list. If all the elements of the lists are female, "female" form is used. If the list has a mix of male, female and neutral names, the "other" form is used.
24933. **maleTaints:** If all the elements of the lists are female, "female" form is used, otherwise the "male" form is used.
2494
2495## <a name="Context_Transform_Elements" href="#Context_Transform_Elements">ContextTransform Elements</a>
2496
2497```xml
2498<!ELEMENT contextTransforms ( alias | (contextTransformUsage*, special*)) >
2499<!ELEMENT contextTransformUsage ( alias | (contextTransform*, special*)) >
2500<!ATTLIST contextTransformUsage type CDATA #REQUIRED >
2501<!ELEMENT contextTransform ( #PCDATA ) >
2502<!ATTLIST contextTransform type ( uiListOrMenu | stand-alone ) #REQUIRED >
2503```
2504
2505CLDR locale elements provide data for display names or symbols in many categories. The default capitalization for these elements is intended to be the form used in the middle of running text. In many languages, other capitalization may be required in other contexts, depending on the type of name or symbol.
2506
2507Each `<contextTransformUsage>` element’s `type` attribute specifies a category of data from the table below; the element includes one or more `<contextTransform>` elements that specify how to perform capitalization of this category of data in different contexts. The `<contextTransform>` elements are needed primarily for cases in which the capitalization is other than the default form used in the middle of running text. However, it is also useful to mark cases in which it is _known_ that no transformation from this default form is needed; this may be necessary, for example, to override the transformation specified by a parent locale. The following values are currently defined for the `<contextTransform>` element:
2508
2509* "titlecase-firstword" designates the case in which raw CLDR text that is in middle-of-sentence form, typically lowercase, needs to have its first word titlecased.
2510* "no-change" designates the case in which it is known that no change from the raw CLDR text (middle-of-sentence form) is needed.
2511
2512Four contexts for capitalization behavior are currently identified. Two need no data, and hence have no corresponding `<contextTransform>` elements:
2513
2514* In the middle of running text: This is the default form, so no additional data is required.
2515* At the beginning of a complete sentence: The initial word is titlecased, no additional data is required to indicate this.
2516
2517Two other contexts require `<contextTransform>` elements if their capitalization behavior is other than the default for running text. The context is identified by the `type` attribute, as follows:
2518
2519* uiListOrMenu: Capitalization appropriate to a user-interface list or menu.
2520* stand-alone: Capitalization appropriate to an isolated user-interface element (e.g. an isolated name on a calendar page)
2521
2522Example:
2523
2524```xml
2525<contextTransforms>
2526    <contextTransformUsage type="languages">
2527        <contextTransform type="uiListOrMenu">titlecase-firstword</contextTransform>
2528        <contextTransform type="stand-alone">titlecase-firstword</contextTransform>
2529    </contextTransformUsage>
2530    <contextTransformUsage type="month-format-except-narrow">
2531        <contextTransform type="uiListOrMenu">titlecase-firstword</contextTransform>
2532    </contextTransformUsage>
2533    <contextTransformUsage type="month-standalone-except-narrow">
2534        <contextTransform type="uiListOrMenu">titlecase-firstword</contextTransform>
2535    </contextTransformUsage>
2536</contextTransforms>
2537```
2538
2539###### Table: <a name="contextTransformUsage_type_attribute_values" href="#contextTransformUsage_type_attribute_values">Element contextTransformUsage type attribute values</a>
2540
2541| type attribute value             | Description |
2542| -------------------------------- | ----------- |
2543| `all`                            | Special value, indicates that the specified transformation applies to all of the categories below |
2544| `language`                       | `localeDisplayNames` language names |
2545| `script`                         | `localeDisplayNames` script names |
2546| `territory`                      | `localeDisplayNames` territory names |
2547| `variant`                        | `localeDisplayNames` variant names |
2548| `key`                            | `localeDisplayNames` key names |
2549| `keyValue`                       | `localeDisplayNames` key value type names |
2550| `month-format-except-narrow`     | `dates/calendars/calendar[type=*]/months` format wide and abbreviated month names |
2551| `month-standalone-except-narrow` | `dates/calendars/calendar[type=*]/months` stand-alone wide and abbreviated month names |
2552| `month-narrow`                   | `dates/calendars/calendar[type=*]/months` format and stand-alone narrow month names |
2553| `day-format-except-narrow`       | `dates/calendars/calendar[type=*]/days` format wide and abbreviated day names |
2554| `day-standalone-except-narrow`   | `dates/calendars/calendar[type=*]/days` stand-alone wide and abbreviated day names |
2555| `day-narrow`                     | `dates/calendars/calendar[type=*]/days` format and stand-alone narrow day names |
2556| `era-name`                       | `dates/calendars/calendar[type=*]/eras` (wide) era names |
2557| `era-abbr`                       | `dates/calendars/calendar[type=*]/eras` abbreviated era names |
2558| `era-narrow`                     | `dates/calendars/calendar[type=*]/eras` narrow era names |
2559| `quarter-format-wide`            | `dates/calendars/calendar[type=*]/quarters` format wide quarter names |
2560| `quarter-standalone-wide`        | `dates/calendars/calendar[type=*]/quarters` stand-alone wide quarter names |
2561| `quarter-abbreviated`            | `dates/calendars/calendar[type=*]/quarters` format and stand-alone abbreviated quarter names |
2562| `quarter-narrow`                 | `dates/calendars/calendar[type=*]/quarters` format and stand-alone narrow quarter names |
2563| `calendar-field`                 | `dates/fields/field[type=*]/displayName` field names<br/>(for relative forms see type "tense" below) |
2564| `zone-exemplarCity`              | `dates/timeZoneNames/zone[type=*]/exemplarCity` city names |
2565| `zone-long`                      | `dates/timeZoneNames/zone[type=*]/long` zone names |
2566| `zone-short`                     | `dates/timeZoneNames/zone[type=*]/short` zone names |
2567| `metazone-long`                  | `dates/timeZoneNames/metazone[type=*]/long` metazone names |
2568| `metazone-short`                 | `dates/timeZoneNames/metazone[type=*]/short` metazone names |
2569| `symbol`                         | `numbers/currencies/currency[type=*]/symbol` symbol names |
2570| `currencyName`                   | `numbers/currencies/currency[type=*]/displayName` currency names |
2571| `currencyName-count`             | `numbers/currencies/currency[type=*]/displayName[count=*]` currency names for use with count |
2572| `relative`                       | `dates/fields/field[type=*]/relative and dates/fields/field[type=*]/relativeTime` relative field names |
2573| `unit-pattern`                   | `units/unitLength[type=*]/unit[type=*]/unitPattern[count=*]` unit names |
2574| `number-spellout`                | `rbnf/rulesetGrouping[type=*]/ruleset[type=*]/rbnfrule` number spellout rules |
2575
2576## <a name="Choice_Patterns" href="#Choice_Patterns">Choice Patterns</a>
2577
2578A choice pattern is a string that chooses among a number of strings, based on numeric value. It has the following form:
2579
2580```
2581<choice_pattern> = <choice> ( '|' <choice> )*
2582<choice> = <number><relation><string>
2583<number> = ('+' | '-')? ('∞' | [0-9]+ ('.' [0-9]+)?)
2584<relation> = '<' | ' ≤'
2585```
2586
2587The interpretation of a choice pattern is that given a number N, the pattern is scanned from right to left, for each choice evaluating `<number> <relation> N`. The first choice that matches results in the corresponding string. If no match is found, then the first string is used. For example:
2588
2589<!-- HTML: rowspan -->
2590
2591<table><tbody>
2592<tr><th>Pattern</th><th>N</th><th>Result</th></tr>
2593<tr><td rowspan="4">0≤Rf|1≤Ru|1&lt;Re</td><td>-∞, -3, -1, -0.000001</td><td>Rf (defaulted to first string)</td></tr>
2594<tr><td>0, 0.01, 0.9999</td><td>Rf</td></tr>
2595<tr><td>1</td><td>Ru</td></tr>
2596<tr><td>1.00001, 5, 99, ∞</td><td>Re</td></tr>
2597</tbody></table>
2598
2599Quoting is done using ' characters, as in date or number formats.
2600
2601## <a name="Annotations" href="#Annotations">Annotations and Labels</a>
2602
2603Annotations provide information about characters, typically used in input. For example, on a mobile keyboard they can be used to do completion. They are typically used for symbols, especially emoji characters.
2604
2605For more information, see version 5.0 or [UTR #51, Unicode Emoji](https://www.unicode.org/reports/tr51/). (Note that during the period between the publication of CLDR v31 and that of Emoji 5.0, the “Latest Proposed Update” link should be used to get to the draft specification for Emoji 5.0.)
2606
2607```xml
2608<!ELEMENT annotations ( annotation* ) >
2609
2610<!ELEMENT annotation ( #PCDATA ) >
2611
2612<!ATTLIST annotation cp CDATA #REQUIRED >
2613
2614<!ATTLIST annotation type (tts) #IMPLIED >
2615```
2616
2617There are two kinds of annotations: **short names**, and **keywords**.
2618
2619With an attribute `type="tts"`, the value is a **short name**, such as one that can be used for text-to-speech. It should be treated as one of the element values for other purposes.
2620
2621When there is no `type` attribute, the value is a set of **keywords**, delimited by |. Spaces around each element are to be trimmed. The **keywords** are words associated with the character(s) that might be used in searching for the character, or in predictive typing on keyboards. The short name itself can be used as a keyword.
2622
2623Here is an example from German:
2624
2625```xml
2626<annotation cp="��">schlecht | Hand | Daumen | nach unten</annotation>
2627<annotation cp="��" type="tts">Daumen runter</annotation>
2628```
2629
2630The `cp` attribute value has two formats: either a single string, or if contained within \[…\] a UnicodeSet. The latter format can contain multiple code points or strings. A code point pr string can occur in multiple annotation element **cp** values, such as the following, which also contains the "thumbs down" character.
2631
2632```xml
2633<annotation cp='[☝✊-✍��-����-����������������������]'>hand</annotation>
2634```
2635
2636Both for short names and keywords, values do not have to match between different languages. They should be the most common values that people using _that_ language would associate with those characters. For example, a "black heart" might have the association of "wicked" in English, but not in some other languages.
2637
2638The cp value may contain sequences, but does not contain any Emoji or Text Variant (VS15 & VS16) characters. All such characters should be removed before looking up any short names and keywords.
2639
2640### <a name="SynthesizingNames" href="#SynthesizingNames">Synthesizing Sequence Names</a>
2641
2642Many emoji are represented by sequences of characters. When there are no `annotation` elements for that string, the short name can be synthesized as follows. **Note:** The process details may change after the release of this specification, and may further change in the future if other sequences are added. Please see the [Known Issues](https://cldr.unicode.org/index/downloads/cldr-41#h.qa3jolg7zi2s) section of the CLDR download page for any updates.
2643
26441.  If **sequence** is an **emoji flag sequence**, look up the territory name in CLDR for the corresponding ASCII characters and return as the short name. For example, the regional indicator symbols P+F would map to “Französisch-Polynesien” in German.
26452.  If **sequence** is an **emoji tag sequence**, look up the subdivision name in CLDR for the corresponding ASCII characters and return as the short name. For example, the TAG characters gbsct would map to “Schottland” in German.
26463.  If **sequence** is a keycap sequence or ��, use the characterLabel for "keycap" as the **prefixName** and set the **suffix** to be the sequence (or "10" in the case of ��), then go to step 8.
26474.  If the **sequence** ends with the string ZWJ + ➡️, look up the name of that sequence with that string removed. Embed that name into the "facing-right" characterLabelPattern and return it.
26485.  Let **suffix** and **prefixName** be "".
26496.  If **sequence** contains any emoji modifiers, move them (in order) into **suffix**, removing them from **sequence**.
26507.  If **sequence** is a "KISS", "HEART", "FAMILY", or "HOLDING HANDS" emoji ZWJ sequence, move the characters in **sequence** to the front of **suffix**, and set the **sequence** to be "��", "��", or "��" respectively, and go to step 7.
2651    1. A KISS sequence contains ZWJ, "��", and "❤", which are skipped in moving to **suffix**.
2652    2. A HEART sequence contains ZWJ and "❤", which are skipped in moving to **suffix**.
2653    3. A HOLDING HANDS sequence contains ZWJ+��+ZWJ, which are skipped in moving to **suffix**.
2654    4. A FAMILY sequence contains only characters from the set {��, ��, ��, ��, ��, ��, ��}. Nothing is skipped in moving to **suffix**, except ZWJ.
26558.  If **sequence** ends with ♂ or ♀, and does not have a name, remove the ♂ or ♀ and move the name for "��" or "��" respectively to the start of **prefixName**.
26569.  Transform **sequence** and append to **prefixName**, by successively getting names for the longest subsequences, skipping any singleton ZWJ characters. If there is more than one name, use the listPattern for unit-short, type=2 to link them.
265710.  Transform **suffix** into **suffixName** in the same manner.
265811. If both the **prefixName** and **suffixName** are non-empty, form the name by joining them with the "category-list" characterLabelPattern and return it. Otherwise return whichever of them is non-empty.
2659
2660The synthesized keywords can follow a similar process.
2661
26621.  For an **emoji flag sequence** or **emoji tag sequence** representing a subdivision, use "flag".
26632.  For keycap sequences, use "keycap".
26643.  For sequences with ZWJ + ➡️, use the keywords for the sequence without the ZWJ + ➡️.
26653.  For other sequences, add the keywords for the subsequences used to get the short names for **prefixName**, and the short names used for **suffixName**.
2666
2667Some examples for English data (v30) are given in the following table.
2668
2669###### Table: Synthesized Emoji Sequence Names
2670
2671| Sequence | Short Name | Keywords |
2672| --------- | ---------- | -------- |
2673| ����        | European Union | flag |
2674| #️⃣        | keycap: # | keycap |
2675| 9️⃣        | keycap: 9 | keycap |
2676| ��        | kiss | couple |
2677| ��‍❤️‍��‍�� | kiss: woman, woman | couple, woman |
2678| ��        | couple with heart | love, couple |
2679| ��‍❤️‍��    | couple with heart: woman, woman | love, couple, woman |
2680| ��        | family | family |
2681| ��‍��‍��        | family: woman, woman, girl | woman, family, girl |
2682| ����        | boy: light skin tone | young, light skin tone, boy |
2683| ����        | woman: dark skin tone | woman, dark skin tone |
2684| ��‍⚖        | man judge | scales, justice, man |
2685| ����‍⚖        | man judge: dark skin tone | scales, justice, dark skin tone, man |
2686| ��‍⚖        | woman judge | woman, scales, judge |
2687| ����‍⚖        | woman judge: medium-light skin tone | woman, scales, medium-light skin tone, judge |
2688| ��        | police officer | police, cop, officer |
2689| ����        | police officer: dark skin tone | police, cop, officer, dark skin tone |
2690| ��‍♂️       | man police officer | police, cop, officer, man |
2691| ����‍♂️       | man police officer: medium-light skin tone | police, cop, officer, medium-light skin tone, man |
2692| ��‍♀️       | woman police officer | police, woman, cop, officer |
2693| ����‍♀️       | woman police officer: dark skin tone | police, woman, cop, officer, dark skin tone |
2694| ��        | person biking | cyclist, bicycle, biking |
2695| ����        | person biking: dark skin tone | cyclist, bicycle, biking, dark skin tone |
2696| ��‍♂️       | man biking | cyclist, bicycle, biking, man |
2697| ����‍♂️       | man biking: dark skin tone | cyclist, bicycle, biking, dark skin tone, man |
2698| ��‍♀️       | woman biking | cyclist, woman, bicycle, biking |
2699| ����‍♀️       | woman biking: dark skin tone | cyclist, woman, bicycle, biking, dark skin tone |
2700
2701For more information, see [Unicode Emoji](https://www.unicode.org/reports/tr51/).
2702
2703### <a name="Character_Labels" href="#Character_Labels">Annotations Character Labels</a>
2704
2705```xml
2706<!ELEMENT characterLabels ( alias | ( characterLabelPattern*, characterLabel*, special* ) ) >
2707
2708<!ELEMENT characterLabelPattern ( #PCDATA ) >
2709
2710<!ATTLIST characterLabelPattern type NMTOKEN #REQUIRED >
2711
2712<!ATTLIST characterLabelPattern count (0 | 1 | zero | one | two | few | many | other) #IMPLIED > <!-- count only used for certain patterns" -->
2713
2714<!ELEMENT characterLabel ( #PCDATA ) >
2715
2716<!ATTLIST characterLabel type NMTOKEN #REQUIRED >
2717```
2718
2719The character labels can be used for categories or groups of characters in a character picker or keyboard palette. They have the above structure. Items with special meanings are explained below. Many of the categories are based on terms used in Unicode. Consult the [Unicode Glossary](https://www.unicode.org/glossary/) where the meaning is not clear.
2720
2721The following are special patterns used in composing labels.
2722
2723###### Table: characterLabelPattern
2724
2725| Type          | English             | Description of the group specified |
2726| ------------- | ------------------- | ----------------------------------- |
2727| all           | {0} — all           | Used where the title {0} is just a subset. For example, {0} might be "Latin", and contain the most common Latin characters. Then "Latin — all" would be all of them. |
2728| category-list | {0}: {1}            | Use for a name, where {0} is the main item like "Family", and {1} is a list of one or more components or subcategories. The list is formatted using a list pattern. |
2729| compatibility | {0} — compatibility | For grouping Unicode compatibility characters separately, such as "Arabic — compatibility". |
2730| enclosed      | {0} — enclosed      | For indicating enclosed forms, such as "digits — enclosed" |
2731| extended      | {0} — extended      | For indicating a group of "extended" characters (special use, technical, etc.) |
2732| historic      | {0} — historic      | For indicating a group of "historic" characters (no longer in common use). |
2733| miscellaneous | {0} — miscellaneous | For indicating a group of "miscellaneous" characters (typically that don't fall into a broader class). |
2734| other         | {0} — other         | Used where the title {0} is just a subset. For example, {0} might be "Latin", and contain the most common Latin characters. Then "Latin — other" would be the rest of them. |
2735| scripts       | scripts — {0}       | For indicating a group of "scripts" characters matching {0}. The value for {0} may be a geographic indicator, like "Africa" (although there are specific combinations listed below), or some other designation, like "other" (from below). |
2736| strokes       | {0} strokes         | Used as an index title for CJK characters. It takes a "count" value, which allows the right plural form to be specified for the language. |
2737| subscript     | subscript {0}       | For indicating subscript forms, such as "subscript digits". |
2738| superscript   | superscript {0}     | For indicating superscript forms, such as "superscript digits". |
2739
2740The following are character labels. Where the meaning of the label is fairly clear (like "animal") or is in the Unicode glossary, it is omitted.
2741
2742###### Table: characterLabel
2743
2744| Type                        | English                 | Description of the group specified |
2745| --------------------------- | ----------------------- | ----------------------------------- |
2746| activities                  | activity                | Human activities, such as running. |
2747| african_scripts             | African script          | Scripts associated with the continent of Africa. |
2748| american_scripts            | American script         | Scripts associated with the continents of North and South America. |
2749| animals_nature              | animal or nature        | A broad category. |
2750| arrows                      | arrow                   | Arrow symbols |
2751| body                        | body                    | Symbols for body parts, such as an arm. |
2752| box_drawing                 | box drawing             | Unicode box-drawing characters (geometric shapes) |
2753| bullets_stars               | bullet or star          | Unicode bullets (such as • or ‣ or ⁍) or stars (★✩✪✵...) |
2754| consonantal_jamo            | consonantal jamo        | Korean Jamo consonants. |
2755| currency_symbols            | currency symbol         | Symbols such as $, ¥, £ |
2756| dash_connector              | dash or connector       | Characters like _ or ⁓ |
2757| dingbats                    | dingbat                 | Font dingbat characters, such as ❿ or ♜. |
2758| downwards_upwards_arrows    | downwards upwards arrow | ⇕,... |
2759| female                      | female                  | Indicates that a character is female or feminine in appearance. |
2760| format                      | format                  | A Unicode format character. |
2761| format_whitespace           | format & whitespace     | A Unicode format character or whitespace. |
2762| full_width_form_variant     | full-width variant      | Full width variant, such as a wide A. |
2763| half_width_form_variant     | half-width variant      | Narrow width variant, such as a half-width katakana character. |
2764| han_characters              | Han character           | Han (aka CJK: Chinese, Japanese, or Korean) ideograph |
2765| han_radicals                | Han radical             | Radical (component) used in Han characters. |
2766| hanja                       | hanja                   | Korean name for Han character. |
2767| hanzi_simplified            | Hanzi (simplified)      | Simplified Chinese ideograph |
2768| hanzi_traditional           | Hanzi (traditional)     | Traditional Chinese ideograph |
2769| historic_scripts            | historic script         | Script no longer in common modern usage, such as Runes or Hieroglyphs. |
2770| ideographic_desc_characters | ideographic desc. character | Special Unicode characters (see the glossary). |
2771| kanji                       | kanji                   | Japanese Han ideograph |
2772| keycap                      | keycap                  | A key on a computer keyboard or phone. For example, the "3" key on a phone or laptop would be "keycap: 3" |
2773| limited_use                 | limited-use             | Not in common modern use. |
2774| male                        | male                    | Indicates that a character is male or masculine in appearance. |
2775| modifier                    | modifier                | A Unicode modifier letter or symbol. |
2776| nonspacing                  | nonspacing              | Used for characters that occupy no width by themselves, such as the ¨ over the a in ä. |
2777| facing-left                 | facing-left             | Characters that face to the left. Also used to construct names for emoji variants. |
2778| facing-right                | facing-right            | Characters that face to the right. Also used to construct names for emoji variants. |
2779
2780### <a name="Typographic_Names" href="#Typographic_Names">Typographic Names</a>
2781
2782```xml
2783<!ELEMENT typographicNames ( alias | ( axisName*, styleName*, featureName*, special* ) ) >
2784
2785<!ELEMENT axisName ( #PCDATA ) >
2786<!ATTLIST axisName type (ital | opsz | slnt | wdth | wght) #REQUIRED >
2787<!ATTLIST axisName alt NMTOKENS #IMPLIED >
2788
2789<!ELEMENT styleName ( #PCDATA ) >
2790<!ATTLIST styleName type (ital | opsz | slnt | wdth | wght) #REQUIRED >
2791<!ATTLIST styleName subtype NMTOKEN #REQUIRED >
2792<!ATTLIST styleName alt NMTOKENS #IMPLIED >
2793
2794<!ELEMENT featureName ( #PCDATA ) >
2795<!ATTLIST featureName type (afrc | cpsp | dlig | frac | lnum | onum | ordn | pnum | smcp | tnum | zero) #REQUIRED >
2796<!ATTLIST featureName alt NMTOKENS #IMPLIED >
2797```
2798
2799The typographic names provide for names of font features for use in a UI. This is useful for apps that show the name of font styles and design axes according to the user’s languages. It would also be useful for system-level libraries.
2800
2801The identifiers (types) use the tags from the [OpenType Feature Tag Registry](https://learn.microsoft.com/en-us/typography/opentype/spec/featuretags). Given their large number, only the names of frequently-used OpenType feature names are available in CLDR. (Many features are not user-visible settings, but instead serve as a data channel for software to pass information to the font.) The example below shows an approach for using the CLDR data. Of course, applications are free to implement their own algorithms depending on their specific needs.
2802
2803To find a localized subfamily name such as “Extraleicht Schmal” for a font called “Extralight Condensed”, a system or application library might do the following:
2804
28051. Determine the set of languages in which the subfamily name can potentially be returned. This is the union of the languages for which the font contains ‘name’ table entries with ID 2 or 17, plus the languages for which CLDR supplies typographic names.
2806
28072. Use a language matching algorithm such as in ICU to find the best available language given the user preferences. The resulting subfamily name will be localized to this language.
2808
28093. If the font’s ‘name’ table contains a typographic subfamily name (ID17) in this language and all font variation axes are set to their defaults, return this name.
2810
28114. If the font’s ‘name’ table contains a font subfamilyname (‘name’ID2) in this language and all font variation axes are set to their defaults, return this name.
2812
28135. If the font has a style attributes (STAT) table, look up the design axis tags and their ordering. If the font has no STAT table, assume \[Width, Weight, Slant\] as axis ordering, and infer the font’s style attributes from other available data in the font (eg. the OS/2 table).
2814
28156. For each design axis, find a localized style name for its value.
2816   1. If the font’s style attributes point to a ‘name’ table entry that is available in the result language, use this name.
2817   2. Otherwise, generate a fallback name from CLDR style Name data.
2818      1. The type key is the OpenType axis tag (‘wght’). The subtype and alt keys are taken from the entry in English CLDR where the string is equal to the English name in the font. For example, when the font uses a weight whose English style name is “Extralight”, this will lead to subtype = “200” and alt = “variant”. If there is no match, take the axis value (“200”) for subtype and the empty string for alt.
2819      2. Look up (type, subtype) in a data table derived from CLDR’s style names. If CLDR supplies multiple alternate names for this (type, subtype), use the one whose “alt” key is matching; otherwise, use the default alternate (which has no “alt” attribute in CLDR).
28207. Concatenate the strings, with a separator between them.
2821
2822## <a name="Grammatical_Features" href="#Grammatical_Features">Grammatical Features</a>
2823
2824LDML supplies grammatical information that can be used to distinguish localized forms on a per-locale basis. The current data is part of an initial phase; the longer term plan is to add structure to permit localized forms based on these features, starting with measurement units such as the dative form in Serbian of “kilometer”. That will allow unit values to be inserted as placeholders into messages and adopt the right forms for grammatical agreement.
2825
2826The current data includes the following:
2827
2828*   There are currently 3 grammatical features found in the [DTD](https://github.com/unicode-org/cldr/blob/main/common/dtd/ldmlSupplemental.dtd#1254): Gender, Case, Definiteness
2829*   There are mappings from supported locales to grammatical features they exhibit in the file [grammaticalFeatures.xml](https://github.com/unicode-org/cldr/blob/main/common/supplemental/grammaticalFeatures.xml). Note that this is supplemental data, so the inheritance to the available locales needs to be done by the client.
2830
2831Note that the CLDR plural categories overlap some of these features, since some languages use case and other devices to change words based on the numeric values.
2832
2833## Features
2834
2835```xml
2836<!ELEMENT grammaticalData ( grammaticalFeatures*, grammaticalDerivations*) >
2837<!ELEMENT grammaticalFeatures ( grammaticalCase*, grammaticalGender*, grammaticalDefiniteness* ) >
2838<!ATTLIST grammaticalFeatures targets NMTOKENS #REQUIRED >
2839<!ATTLIST grammaticalFeatures locales NMTOKENS #REQUIRED >
2840
2841<!ELEMENT grammaticalCase EMPTY>
2842<!ATTLIST grammaticalCase scope NMTOKENS #IMPLIED >
2843<!ATTLIST grammaticalCase values NMTOKENS #REQUIRED >
2844
2845<!ELEMENT grammaticalGender EMPTY>
2846<!ATTLIST grammaticalGender scope NMTOKENS #IMPLIED >
2847<!ATTLIST grammaticalGender values NMTOKENS #REQUIRED >
2848
2849<!ELEMENT grammaticalDefiniteness EMPTY>
2850<!ATTLIST grammaticalDefiniteness scope NMTOKENS #IMPLIED >
2851<!ATTLIST grammaticalDefiniteness values NMTOKENS #REQUIRED >
2852```
2853
2854The @targets attribute contains the specific grammatical entities to which the features apply, such as ```nominal``` when they apply to nouns only. The @locales attribute contains the specific locales to which the features apply, such as ```de fr``` for German and French.
2855
2856The @scope attribute, if present, indicates that the values are limited to a specific subset for certain kinds of entities. For example, a particular language might have an animate gender for nouns, but no units of measurement ever have that case; in another language, the language might have a rich set of grammatical cases, but units are invariant. If the @scope attribute is not present, then that has the meaning of "everything else".
2857
2858The @scope attributes are targeted at messages created by computers, thus a feature may have a narrower scope if for all practical purposes the feature value is not used in messages created by computers. For example, it may be possible in theory for a kilogram to be in the vocative case (English poetry might have “O Captain! my Captain!/ our fearful trip is done”, but on computers you have little call to need the message “O kilogram! my kilogram! …”).
2859
2860**Constraints:**
2861
2862* a scope attribute is only used when there is a corresponding “general” element, one for the same language and target without a scope attribute.
2863* the scope attribute values must be narrower (a proper subset, possibly empty) of those in the corresponding general element.
2864
2865### <a name="Gender" href="#Gender">Gender</a>
2866
2867Feature that classifies nouns in classes.
2868This is grammatical gender, which may be assigned on the basis of sex in some languages, but may be completely separate in others.
2869Also used to tag elements in CLDR that should agree with a particular gender of an associated noun.
2870(adapted from: [linguistics-ontology.org/gold/2010/GenderProperty](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/GenderProperty) - the links below go to an archived version. The original site is no longer available, as explained at <https://linguistlist.org/gold/>.)
2871
2872The term "gender" is somewhat of a misnomer, because CLDR treats "gender" as a broad term, equivalent to "noun class".
2873Thus it bundles noun class categories such as gender and animacy into a single identifier, such as "feminine-animate".
2874
2875#### Example
2876
2877```xml
2878<grammaticalFeatures targets="nominal" locales="es fr it pt">
2879   <grammaticalGender values="masculine feminine"/>
2880```
2881
2882#### Table: Values
2883
2884| Value     | Definition | References |
2885| --------- | ---------- | ---------- |
2886| animate   | In an animate/inanimate gender system, gender that denotes human or animate entities. | description adapted from: [wikipedia.org/wiki/Grammatical_gender](https://en.wikipedia.org/wiki/Grammatical_gender), [linguistics-ontology.org/gold/2010/AnimateGender](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/AnimateGender) |
2887| inanimate | In an animate/inanimate gender system, gender that denotes object or inanimate entities .| adapted from: [wikipedia.org/wiki/Grammatical_gender](https://en.wikipedia.org/wiki/Grammatical_gender), [linguistics-ontology.org/gold/2010/InanimateGender](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/InanimateGender) |
2888| personal  | In an animate/inanimate gender system in some languages, gender that specifies the masculine gender of animate entities. | adapted from: [wikipedia.org/wiki/Grammatical_gender](https://en.wikipedia.org/wiki/Grammatical_gender), [linguistics-ontology.org/gold/2010/HumanGender](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/HumanGender) |
2889| common    | In a common/neuter gender system, gender that denotes human entities. | adapted from: [wikipedia.org/wiki/Grammatical_gender](https://en.wikipedia.org/wiki/Grammatical_gender) |
2890| feminine  | In a masculine/feminine or in a masculine/feminine/neuter gender system, gender that denotes specifically female persons (or animals) or that is assigned arbitrarily to object. | adapted from: https://en.wikipedia.org/wiki/Grammatical_gender, [linguistics-ontology.org/gold/2010/FeminineGender](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/FeminineGender) |
2891| masculine | In a masculine/feminine or in a masculine/feminine/neuter gender system, gender that denotes specifically male persons (or animals) or that is assigned arbitrarily to object. | adapted from: [wikipedia.org/wiki/Grammatical_gender](https://en.wikipedia.org/wiki/Grammatical_gender), [linguistics-ontology.org/gold/2010/MasculineGender](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/MasculineGender) |
2892| neuter    | In a masculine/feminine/neuter or common/neuter gender system, gender that generally denotes an object. | adapted from: [wikipedia.org/wiki/Grammatical_gender](https://en.wikipedia.org/wiki/Grammatical_gender), [linguistics-ontology.org/gold/2010/NeuterGender](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/NeuterGender) |
2893
2894There are further simplifications in the identifiers.
2895For example, consider a language that has 3 genders, and two levels of animacy, but only for masculine.
2896The set of combinations would be:
2897
2898* masculine-animate
2899* masculine-inanimate
2900* feminine-unspecified
2901* neuter-unspecified
2902
2903In such a case as this, CLDR abbreviates these as the following identifiers:
2904
2905* masculine
2906* inanimate
2907* feminine
2908* neuter
2909
2910That is:
2911* unspecified and animate are dropped.
2912* if there is only a single gender with inanimate, then the gender is dropped.
2913
2914### <a name="Case" href="#Case">Case</a>
2915
2916#### Table: Case
2917
2918Feature that encodes the syntactic (and sometimes semantic) relationship of a noun with the other constituents of the sentence. (adapted from [linguistics-ontology.org/gold/2010/CaseProperty](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/CaseProperty))
2919
2920##### Example
2921
2922```xml
2923<grammaticalFeatures targets="nominal" locales="de">
2924   <grammaticalCase values="nominative accusative genitive dative"/>
2925```
2926
2927###### Table: Values
2928
2929| Value              | Definition | References |
2930| ------------------ | ---------- | ---------- |
2931| abessive          | The abessive case expresses the absence of the referent it marks. It has the meaning of 'without'. | [purl.org/olia/olia.owl#AbessiveCase](https://purl.org/olia/olia.owl#AbessiveCase) [linguistics-ontology.org/gold/2010/AbessiveCase](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/AbessiveCase)|
2932| ablative           | The ablative case expresses that the referent of the noun it marks is the location from which another referent is moving. It has the meaning 'from'. | [purl.org/olia/olia.owl#AblativeCase](https://purl.org/olia/olia.owl#AblativeCase), [linguistics-ontology.org/gold/2010/AblativeCase](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/AblativeCase) |
2933| accusative         | Accusative case marks certain syntactic functions, usually direct objects. | [purl.org/olia/olia.owl#Accusative](https://purl.org/olia/olia.owl#Accusative), [linguistics-ontology.org/gold/2010/AccusativeCase](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/AccusativeCase) |
2934| adessive  | The adessive case expresses that the referent of the noun it marks is the location near/at which another referent exists. It has the meaning of 'at' or 'near'. | [purl.org/olia/olia.owl#AdessiveCase](https://purl.org/olia/olia.owl#AdessiveCase), [linguistics-ontology.org/gold/2010/AdessiveCase](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/AdessiveCase) |
2935| allative | The allative case expresses motion to or toward the referent of the noun it marks. | [purl.org/olia/olia.owl#AllativeCase](https://purl.org/olia/olia.owl#AllativeCase), [linguistics-ontology.org/gold/2010/AllativeCase](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/AllativeCase) |
2936| causal | The causal (causal-final, not causative) case expresses that the marked noun is the objective or reason for something. It carries the meaning of 'for the purpose of'. | https://en.wikipedia.org/wiki/Causative#Causal-final_case, http://www.hungarianreference.com/Nouns/%C3%A9rt-causal-final.aspx |
2937| comitative         | Comitative Case expresses accompaniment. It carries the meaning 'with' or 'accompanied by' . | [purl.org/olia/olia.owl#ComitativeCase](https://purl.org/olia/olia.owl#ComitativeCase), [linguistics-ontology.org/gold/2010/ComitativeCase](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/ComitativeCase) |
2938| dative             | Dative case marks indirect objects (for languages in which they are held to exist), or nouns having the role of a recipient (as of things given), a beneficiary of an action, or a possessor of an item. | [purl.org/olia/olia.owl#DativeCase](https://purl.org/olia/olia.owl#DativeCase), [linguistics-ontology.org/gold/2010/DativeCase](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/DativeCase) |
2939| delative | The delative case expresses motion downward from the referent of the noun it marks. | [purl.org/olia/olia.owl#DelativeCase](https://purl.org/olia/olia.owl#DelativeCase), [linguistics-ontology.org/gold/2010/DelativeCase](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/DelativeCase) |
2940| elative | The elative case expresses that the referent of the noun it marks is the location out of which another referent is moving. It has the meaning 'out of'. | [purl.org/olia/olia.owl#ElativeCase](https://purl.org/olia/olia.owl#ElativeCase), [linguistics-ontology.org/gold/2010/ElativeCase](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/ElativeCase) |
2941| ergative           | In ergative-absolutive languages, the ergative case identifies the subject of a transitive verb. | [purl.org/olia/olia.owl#ErgativeCase](https://purl.org/olia/olia.owl#ErgativeCase), [linguistics-ontology.org/gold/2010/ErgativeCase](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/ErgativeCase) |
2942| essive | The essive case expresses that the referent of the noun it marks is the location at which another referent exists. | [purl.org/olia/olia.owl#EssiveCase](https://purl.org/olia/olia.owl#EssiveCase), [linguistics-ontology.org/gold/2010/EssiveCase](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/EssiveCase) |
2943| genitive           | Genitive case signals that the referent of the marked noun is the possessor of the referent of another noun, e.g. "the man's foot". In some languages, genitive case may express an associative relation between the marked noun and another noun. | [purl.org/olia/olia.owl#GenitiveCase](https://purl.org/olia/olia.owl#GenitiveCase), [linguistics-ontology.org/gold/2010/GenitiveCase](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/GenitiveCase) |
2944| illative | The illative case expresses that the referent of the noun it marks is the location into which another referent is moving. It has the meaning 'into'. | [purl.org/olia/olia.owl#IllativeCase](https://purl.org/olia/olia.owl#IllativeCase), [linguistics-ontology.org/gold/2010/IllativeCase](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/IllativeCase) |
2945| inessive  | The inessive case expresses that the referent of the noun it marks is the location within which another referent exists. It has the meaning of 'within' or 'inside'.  | [purl.org/olia/olia.owl#InessiveCase](https://purl.org/olia/olia.owl#InessiveCase), [linguistics-ontology.org/gold/2010/InessiveCase](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/InessiveCase) |
2946| instrumental       | The instrumental case indicates that the referent of the noun it marks is the means of the accomplishment of the action expressed by the clause. | [purl.org/olia/olia.owl#InstrumentalCase](https://purl.org/olia/olia.owl#InstrumentalCase), [linguistics-ontology.org/gold/2010/InstrumentalCase](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/InstrumentalCase) |
2947| locative           | Case that indicates a final location of action or a time of the action. | [purl.org/olia/olia.owl#LocativeCase](https://purl.org/olia/olia.owl#LocativeCase), [linguistics-ontology.org/gold/2010/LocativeCase](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/LocativeCase) |
2948| locativecopulative | Copulative Case marker that indicates a location. | TBD Add reference, example |
2949| nominative         | In nominative-accusative languages, nominative case marks clausal subjects and is applied to nouns in isolation | [purl.org/olia/olia.owl#Nominative](https://purl.org/olia/olia.owl#Nominative), [linguistics-ontology.org/gold/2010/NominativeCase](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/NominativeCase) |
2950| oblique            | Case that is used when a noun is the object of a verb or a proposition, except for nominative and vocative case. | [purl.org/olia/olia.owl#ObliqueCase](https://purl.org/olia/olia.owl#ObliqueCase) |
2951| partitive          | The partitive case is a grammatical case which denotes 'partialness', 'without result', or 'without specific identity'. | [purl.org/olia/olia.owl#PartitiveCase](https://purl.org/olia/olia.owl#PartitiveCase), [linguistics-ontology.org/gold/2010/PartitiveCase](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/PartitiveCase) |
2952| prepositional      | Prepositional case refers to case marking that only occurs in combination with prepositions. | [purl.org/olia/olia.owl#PrepositionalCase](https://purl.org/olia/olia.owl#PrepositionalCase) |
2953| sociative          | Case related to the person in whose company the action is carried out, or to any belongings of people which take part in the action. | [purl.org/olia/olia.owl#SociativeCase](https://purl.org/olia/olia.owl#SociativeCase) |
2954| sublative  | The sublative case expresses that the referent of the noun it marks is the location under which another referent is moving toward. It has the meaning 'towards the underneath of'. | [purl.org/olia/olia.owl#SublativeCase](https://purl.org/olia/olia.owl#SublativeCase), [linguistics-ontology.org/gold/2010/SublativeCase](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/SublativeCase) |
2955| superessive  | The superessive case expresses that the referent of the noun it marks is the location on which another referent exists. It has the meaning of 'on' or 'upon'. | [purl.org/olia/olia.owl#SuperessiveCase](https://purl.org/olia/olia.owl#SuperessiveCase), [linguistics-ontology.org/gold/2010/SuperessiveCase](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/SuperessiveCase) |
2956| terminative  | The terminative case expresses the motion of something into but not further than (ie, not through) the referent of the noun it marks. It has the meaning 'into but not through'.  | [purl.org/olia/olia.owl#TerminativeCase](https://purl.org/olia/olia.owl#TerminativeCase), [linguistics-ontology.org/gold/2010/TerminativeCase](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/TerminativeCase) |
2957| translative  | The translative case expresses that the referent of the noun that it marks is the result of a process of change. It has the meaning of 'becoming' or 'changing into'.  | [purl.org/olia/olia.owl#TranslativeCase](https://purl.org/olia/olia.owl#TranslativeCase), [linguistics-ontology.org/gold/2010/TranslativeCase](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/TranslativeCase) |
2958| vocative           | Vocative case marks a noun whose referent is being addressed. | [purl.org/olia/olia.owl#VocativeCase](https://purl.org/olia/olia.owl#VocativeCase), [linguistics-ontology.org/gold/2010/VocativeCase](https://web.archive.org/20200115041525/linguistics-ontology.org/gold/2010/VocativeCase) |
2959
2960### Definiteness
2961
2962Feature that encodes the fact that a noun has been already mentioned, or is familiar in the discourse. (adapted from [https://glossary.sil.org/term/definiteness](https://glossary.sil.org/term/definiteness))
2963
2964#### Table: Values
2965
2966| Value       | Definition | References |
2967| ----------- | ---------- | ---------- |
2968| definite    | Value referring to the capacity of identification of an entity. | [purl.org/olia/olia.owl#Definite](https://purl.org/olia/olia.owl#Definite) |
2969| indefinite  | An entity is specified as indefinite when it refers to a non-particularized individual of the species denoted by the noun. | [purl.org/olia/olia.owl#Indefinite](https://purl.org/olia/olia.owl#Indefinite) |
2970| construct   | The state of the first noun in a genitive phrase of a possessed noun followed by a possessor noun. | Not directly linked, but explained under: [purl.org/olia/olia-top.owl#DefinitenessFeature](https://purl.org/olia/olia-top.owl#DefinitenessFeature) |
2971| unspecified | Noun without any definiteness marking in some specific construction (specific to Danish). |   |
2972
2973
2974## <a name="Grammatical_Derivations" href="#Grammatical_Derivations">Grammatical Derivations</a>
2975
2976```xml
2977<!ELEMENT grammaticalData ( grammaticalFeatures*, grammaticalDerivations*) >
2978<!ELEMENT grammaticalDerivations (deriveCompound*, deriveComponent*) >
2979<!ATTLIST grammaticalDerivations locales NMTOKENS #REQUIRED >
2980
2981<!ELEMENT deriveCompound EMPTY >
2982<!ATTLIST deriveCompound feature NMTOKENS #REQUIRED >
2983<!ATTLIST deriveCompound structure NMTOKENS #REQUIRED >
2984<!ATTLIST deriveCompound value NMTOKEN #REQUIRED >
2985
2986<!ATTLIST deriveComponent feature NMTOKENS #REQUIRED >
2987<!ATTLIST deriveComponent structure NMTOKENS #REQUIRED >
2988<!ATTLIST deriveComponent value0 NMTOKEN #REQUIRED >
2989<!ATTLIST deriveComponent value1 NMTOKEN #REQUIRED >
2990```
2991
2992The grammatical derivation data contains information about the case, gender, and plural categories of compound units. This is supplemental data, so the inheritance by locale needs to be done by the client.
2993
2994_Note: In CLDR v38, the data for two locales is provided so that implemenations can ready their code for when more locale data is available. In subsequent releases structure may be further extended as more locales are added, to deal with additional locale requirements._
2995
2996A compound unit can use 4 mechanisms, illustrated here in formatted strings:
2997
2998* **Prefix**: 1  **kilo**gram
2999* **Power**: 3 **square** kilometers
3000* **Per**: 3 kilograms **per** meter
3001  * An edge case is where there is no numerator, such as “1 per-second”
3002* **Times**: 3 kilowatt<strong>-</strong>hours
3003
3004For the purposes of grammatical derivation (and name construction), a compound unit ID can be represented as a tree structure where the leaves are the atomic units, and the higher level node are one of the above. Here is an extreme example of that: _kilogram-square-kilometer-ampere-candela-per-square-second-mole_
3005
3006<!-- HTML: colspan -->
3007
3008<table><tbody>
3009<tr><th colspan="6">per</th></tr>
3010<tr><th colspan="4">times</th><th colspan="2">times</th></tr>
3011<tr><th>kilo</th><th>square</th><td>ampere</td><td>candela</td><th>square</th><td>mole</td></tr>
3012<tr><td>gram</td><th>kilo</th><td>-</td><td>-</td><td>second</td><td></td></tr>
3013<tr><td>-</td><td>meter</td><td>-</td><td>-</td><td colspan="2">-</td></tr>
3014</tbody></table>
3015
3016Note that the prefix and power nodes are unary (exactly 1 child), the per pattern is unary or binary (1 or 2 children), and the times pattern is n-ary (where n > 1).
3017
3018Each section below is only applicable if the language has more than one value _for units_: for example, for plural categories the language has to have more than just "other". When that information is available for a language, it is found in **[Grammatical Features](#Grammatical_Features)**.
3019
3020The gender derivation would be appropriate for an API call like `String genderValue = getGrammaticalGender(locale, "kilogram-meter-per-square-second")`. This can be used where the choice of word forms in the rest of a phrase can depend on the gender of the unit.
3021
3022On the other hand, the derivation of plural category and case are used in building up the name of a compound unit, where the desired plural category is available from the number to be formatted with the unit, and the case value is known from the position in a message. For example, the case could be accusative if the formatted unit is to be the direct object in a sentence or phrase. This could be expressed in an API call such as `String inflectedName = getUnitName(locale, "kilogram-meter-per-square-second", pluralCategory, caseValue)`.
3023
3024When deriving an inflected compound unit pattern, as the tree-stucture is processed by getting the appropriate localized patterns for the structural components and names for the atomic components. The computation of the plural category and the case of the subtrees can be computed from the **deriveComponent** data. The **times** data is treated as binary, and applied from left to right: with the example from above, the plural categories for the components of _kilogram-square-kilometer-ampere-candela_ are computed by applying
3025
3026**times**(_kilogram, **times**(square-kilometer, **times**(ampere, candela)))_
3027
3028For a description of how to use these fields to construct a localized name, see **[Compound Units](#compound-units)**.
3029
3030### <a name="gender_compound_units" href="#gender_compound_units">Deriving the Gender of Compound Units</a>
3031
3032The **deriveCompound\[@feature="gender"\]** data provides information for how to derive the gender of the whole compound from the gender of its atomic units and structure. The `attributeValues` of value are: **`0` (=gender of the first element), `1` (=gender of second element), or one of the valid gender values for the language.** In the unusual case that the 'per' compound has no first element and 0 is supplied, then the value is 1.
3033
3034Example:
3035
3036```xml
3037<deriveCompound feature="gender" structure="per" value="0" /> <!-- gender(gram-per-meter) ← gender(gram) -->
3038<deriveCompound feature="gender" structure="times" value="1" /> <!-- gender(newton-meter) ← gender(meter) -->
3039<deriveCompound feature="gender" structure="power" value="0" /> <!-- gender(square-meter) ← gender(meter) -->
3040<deriveCompound feature="gender" structure="prefix" value="0" /> <!-- gender(kilometer) ← gender(meter) -->
3041```
3042
3043For example, for gram-per-meter, the first line above means:
3044
3045* The gender of the compound is the gender of the first component of the 'per', that is, of the "gram". So if gram is feminine in that language, the gender of the compound is feminine.
3046
3047
3048### <a name="plural_compound_units" href="#plural_compound_units">Deriving the Plural Category of Unit Components</a>
3049
3050The `deriveComponent[@feature="plural"]` data provides information for how to derive the plural category for each of the atomic units, from the plural category of the whole compound and the structure of the compound. The `attributeValues` of `value0` and `value1` are: `compound` (=the `pluralCategory` of the compound), or one of the valid plural category values for the language.
3051
3052Example:
3053
3054```xml
3055<deriveComponent feature="plural" structure="per" value0="compound" value1="one" /> <!-- compound(gram-per-meter) ⇒  compound(gram) “per" singular(meter) -->
3056<deriveComponent feature="plural" structure="times" value0="one"  value1="compound" />  <!-- compound(newton-meter) ⇒  singular(newton) “-" compound(meter) -->
3057<deriveComponent feature="plural" structure="power" value0="one"  value1="compound" />  <!-- compound(square-meter) ⇒  singular(square) compound(meter) -->
3058<deriveComponent feature="plural" structure="prefix" value0="one"  value1="compound" /> <!-- compound(kilometer) ⇒  singular(kilo) compound(meter) -->
3059```
3060
3061For example, for gram-per-meter, the first line above means:
3062
3063*   When the plural form of gram-per-meter is needed (rather than singular), then the gram part of the translation has to have a plural form like “grams”, while the meter part of the translation has to have a singular form like “metre”. This would be composed with the pattern for "per" (say "{0} pro {1}") to get "grams pro metre".
3064
3065
3066### <a name="case_compound_units" href="#case_compound_units">Deriving the Case of Unit Components</a>
3067
3068The `deriveComponent[@feature="case"]` data provides information for how to derive the grammatical case for each of the atomic units, from the grammatical case of the whole compound and the structure of the compound. The `attributeValues` of value0 and value1 are: `compound` (=the grammatical case of the compound), or one of the valid grammatical case values for the language.
3069
3070Example:
3071
3072```xml
3073<deriveComponent feature="case" structure="per" value0="compound" value1="nominative" /> <!-- compound(gram-per-meter) ⇒ compound(gram) “per" accusative(meter) -->
3074<deriveComponent feature="case" structure="times" value0="nominative"  value1="compound" /> <!-- compound(newton-meter) ⇒  nominative(newton) “-" compound(meter) -->
3075<deriveComponent feature="case" structure="power" value0="nominative"  value1="compound" /> <!-- compound(square-meter) ⇒  nominative(square) compound(meter) -->
3076<deriveComponent feature="case" structure="prefix" value0="nominative"  value1="compound" /><!--compound(kilometer) ⇒  nominative(kilo) compound(meter) -->
3077```
3078
3079For example, for gram-per-meter, the first line above means:
3080
3081* When the accusative form of gram-per-meter is needed, then the gram part of the translation has the accusative case (eg, “gramu”, in a language that marks the accusative case with 'u'), while the meter part of the translation has a nominative form like “metre”. This would be composed with the pattern for "per" (say "{0} pro {1}") to get "gramu pro metre".
3082
3083* * *
3084
3085Copyright © 2001–2024 Unicode, Inc. All Rights Reserved. The Unicode Consortium makes no expressed or implied warranty of any kind, and assumes no liability for errors or omissions. No liability is assumed for incidental and consequential damages in connection with or arising out of the use of the information or programs contained or accompanying this technical report. The Unicode [Terms of Use](https://www.unicode.org/copyright.html) apply.
3086
3087Unicode and the Unicode logo are trademarks of Unicode, Inc., and are registered in some jurisdictions.
3088