ICU-21165 Add LdmlConverter UNITS output, update SUPPLEMENTAL_DATA.

- Produce new supplementalData.txt and units.txt with:

      ant -f build-icu-data.xml -DoutDir=/tmp/new_dir \
          -DcldrVersion=37 -DoutputTypes=UNITS,SUPPLEMENTAL_DATA
This commit is contained in:
Hugo van der Merwe 2020-06-15 17:21:13 +02:00 committed by Hugo
parent 6a1df9e16c
commit 55127d6778
4 changed files with 1957 additions and 525 deletions

View File

@ -35765,525 +35765,6 @@ supplementalData:table(nofallback){
preferred{"H"}
}
}
unitPreferenceData{
001{
area-default{
"square-kilometer",
"hectare",
"square-meter",
"square-centimeter",
}
area-geograph{"square-kilometer"}
area-land{"hectare"}
concentration-default{"item-per-cubic-meter"}
consumption-default{"liter-per-100-kilometer"}
consumption-inverse-default{"kilometer-per-centiliter"}
consumption-inverse-vehicle-fuel{"kilometer-per-centiliter"}
consumption-vehicle-fuel{"liter-per-100-kilometer"}
duration-default{
"day",
"hour",
"minute",
"second",
"millisecond",
"microsecond",
"nanosecond",
}
duration-media{
"minute-and-second",
"second",
}
energy-default{"kilowatt-hour"}
energy-food{"kilocalorie"}
length-default{
"kilometer",
"meter",
"centimeter",
}
length-person{"centimeter"}
length-person-height{"centimeter"}
length-rainfall{"millimeter"}
length-road{"meter"}
length-snowfall{"centimeter"}
length-vehicle{"meter"}
length-visiblty{"meter"}
mass-default{
"metric-ton",
"kilogram",
"gram",
"milligram",
"microgram",
}
mass-density-blood-glucose{"milligram-per-deciliter"}
mass-density-default{"kilogram-per-cubic-meter"}
mass-person{
"kilogram",
"gram",
}
power-default{
"gigawatt",
"megawatt",
"kilowatt",
"watt",
"milliwatt",
}
power-engine{"kilowatt"}
pressure-baromtrc{"hectopascal"}
pressure-default{
"megapascal",
"pascal",
}
speed-default{"kilometer-per-hour"}
speed-wind{"kilometer-per-hour"}
temperature-default{"celsius"}
temperature-weather{"celsius"}
volume-default{
"cubic-meter",
"cubic-centimeter",
}
volume-fluid{
"liter",
"milliliter",
}
volume-oil{"barrel"}
volume-vehicle{"liter"}
year-duration-default{
"year",
"month",
}
year-duration-person-age{
"year-person-and-month-person",
"month-person",
}
}
AG{
concentration-blood-glucose{"millimole-per-liter"}
}
AI{
concentration-blood-glucose{"millimole-per-liter"}
}
AO{
concentration-blood-glucose{"millimole-per-liter"}
}
AT{
length-person-height{"meter-and-centimeter"}
}
AU{
concentration-blood-glucose{"millimole-per-liter"}
}
BA{
concentration-blood-glucose{"millimole-per-liter"}
}
BE{
length-person-height{"meter-and-centimeter"}
}
BG{
concentration-blood-glucose{"millimole-per-liter"}
}
BH{
concentration-blood-glucose{"millimole-per-liter"}
}
BM{
concentration-blood-glucose{"millimole-per-liter"}
}
BN{
concentration-blood-glucose{"millimole-per-liter"}
}
BR{
consumption-vehicle-fuel{"liter-per-kilometer"}
length-person-height{"meter-and-centimeter"}
length-rainfall{"centimeter"}
pressure-baromtrc{"millibar"}
}
BS{
temperature-weather{"fahrenheit"}
}
BW{
concentration-blood-glucose{"millimole-per-liter"}
}
BY{
concentration-blood-glucose{"millimole-per-liter"}
}
BZ{
temperature-weather{"fahrenheit"}
}
CA{
concentration-blood-glucose{"millimole-per-liter"}
consumption-inverse-vehicle-fuel{"mile-per-gallon-imperial"}
length-person{"inch"}
length-person-height{"inch"}
}
CH{
concentration-blood-glucose{"millimole-per-liter"}
}
CM{
concentration-blood-glucose{"millimole-per-liter"}
}
CN{
concentration-blood-glucose{"millimole-per-liter"}
length-person-height{"meter-and-centimeter"}
}
CZ{
concentration-blood-glucose{"millimole-per-liter"}
}
DE{
length-person-height{"meter-and-centimeter"}
length-visiblty{"meter"}
}
DK{
concentration-blood-glucose{"millimole-per-liter"}
length-person-height{"meter-and-centimeter"}
}
DM{
concentration-blood-glucose{"millimole-per-liter"}
}
DZ{
length-person-height{"meter-and-centimeter"}
mass-person{"kilogram-and-gram"}
}
EE{
concentration-blood-glucose{"millimole-per-liter"}
}
EG{
length-person-height{"meter-and-centimeter"}
mass-person{"kilogram-and-gram"}
pressure-baromtrc{"millibar"}
}
ES{
length-person-height{"meter-and-centimeter"}
mass-person{"kilogram-and-gram"}
}
FI{
concentration-blood-glucose{"millimole-per-liter"}
speed-wind{"meter-per-second"}
}
FJ{
concentration-blood-glucose{"millimole-per-liter"}
}
FR{
length-person-height{"meter-and-centimeter"}
}
GB{
area-default{
"square-mile",
"acre",
"square-foot",
"square-inch",
}
area-geograph{"square-mile"}
area-land{"acre"}
concentration-blood-glucose{"millimole-per-liter"}
consumption-inverse-vehicle-fuel{"mile-per-gallon-imperial"}
length-default{
"mile",
"foot",
"inch",
}
length-person{"inch"}
length-person-height{"inch"}
length-road{"yard"}
length-vehicle{"foot-and-inch"}
length-visiblty{
"mile",
"foot",
}
mass-default{
"ton",
"pound",
"ounce",
}
mass-person{
"stone-and-pound",
"pound-and-ounce",
}
power-engine{"horsepower"}
pressure-baromtrc{"millibar"}
pressure-default{"pound-force-per-square-inch"}
speed-default{"mile-per-hour"}
volume-default{
"cubic-foot",
"cubic-inch",
}
volume-fluid{
"gallon-imperial",
"fluid-ounce-imperial",
}
}
GD{
concentration-blood-glucose{"millimole-per-liter"}
}
HK{
concentration-blood-glucose{"millimole-per-liter"}
length-person-height{"meter-and-centimeter"}
mass-person{"pound-and-ounce"}
}
HR{
concentration-blood-glucose{"millimole-per-liter"}
}
HU{
concentration-blood-glucose{"millimole-per-liter"}
}
ID{
length-person-height{"meter-and-centimeter"}
}
IE{
concentration-blood-glucose{"millimole-per-liter"}
}
IL{
length-person-height{"meter-and-centimeter"}
pressure-baromtrc{"millibar"}
}
IM{
concentration-blood-glucose{"millimole-per-liter"}
}
IN{
length-person{"inch"}
length-person-height{"inch"}
pressure-baromtrc{"inch-ofhg"}
}
IS{
concentration-blood-glucose{"millimole-per-liter"}
}
IT{
consumption-vehicle-fuel{"liter-per-kilometer"}
length-person-height{"meter-and-centimeter"}
}
JO{
length-person-height{"meter-and-centimeter"}
mass-person{"kilogram-and-gram"}
}
JP{
consumption-vehicle-fuel{"liter-per-kilometer"}
}
KE{
concentration-blood-glucose{"millimole-per-liter"}
}
KN{
concentration-blood-glucose{"millimole-per-liter"}
}
KR{
consumption-vehicle-fuel{"liter-per-kilometer"}
speed-wind{"meter-per-second"}
}
KW{
concentration-blood-glucose{"millimole-per-liter"}
}
KY{
temperature-weather{"fahrenheit"}
}
KZ{
concentration-blood-glucose{"millimole-per-liter"}
}
LC{
concentration-blood-glucose{"millimole-per-liter"}
}
LI{
concentration-blood-glucose{"millimole-per-liter"}
}
LT{
concentration-blood-glucose{"millimole-per-liter"}
}
LU{
concentration-blood-glucose{"millimole-per-liter"}
}
LV{
concentration-blood-glucose{"millimole-per-liter"}
}
ME{
concentration-blood-glucose{"millimole-per-liter"}
}
MG{
concentration-blood-glucose{"millimole-per-liter"}
}
MK{
concentration-blood-glucose{"millimole-per-liter"}
}
MO{
concentration-blood-glucose{"millimole-per-liter"}
}
MS{
concentration-blood-glucose{"millimole-per-liter"}
}
MT{
concentration-blood-glucose{"millimole-per-liter"}
}
MU{
concentration-blood-glucose{"millimole-per-liter"}
}
MX{
consumption-vehicle-fuel{"liter-per-kilometer"}
length-person-height{"meter-and-centimeter"}
length-vehicle{"meter-and-centimeter"}
pressure-baromtrc{"millimeter-ofhg"}
}
MY{
concentration-blood-glucose{"millimole-per-liter"}
consumption-vehicle-fuel{"liter-per-kilometer"}
length-person-height{"meter-and-centimeter"}
}
MZ{
concentration-blood-glucose{"millimole-per-liter"}
}
NA{
concentration-blood-glucose{"millimole-per-liter"}
}
NL{
concentration-blood-glucose{"millimole-per-liter"}
consumption-vehicle-fuel{"liter-per-kilometer"}
length-person-height{"meter-and-centimeter"}
length-visiblty{"meter"}
}
NO{
concentration-blood-glucose{"millimole-per-liter"}
length-person-height{"meter-and-centimeter"}
speed-wind{"meter-per-second"}
}
NZ{
concentration-blood-glucose{"millimole-per-liter"}
}
OM{
concentration-blood-glucose{"millimole-per-liter"}
}
PG{
concentration-blood-glucose{"millimole-per-liter"}
}
PL{
length-person-height{"meter-and-centimeter"}
speed-wind{"meter-per-second"}
}
PR{
temperature-weather{"fahrenheit"}
}
PT{
length-person-height{"meter-and-centimeter"}
}
PW{
temperature-weather{"fahrenheit"}
}
RS{
concentration-blood-glucose{"millimole-per-liter"}
}
RU{
concentration-blood-glucose{"millimole-per-liter"}
length-person-height{"meter-and-centimeter"}
pressure-baromtrc{"millimeter-ofhg"}
speed-wind{"meter-per-second"}
}
SA{
length-person-height{"meter-and-centimeter"}
mass-person{"kilogram-and-gram"}
}
SE{
concentration-blood-glucose{"millimole-per-liter"}
length-person-height{"meter-and-centimeter"}
length-road{
"mile-scandinavian",
"kilometer",
}
speed-wind{"meter-per-second"}
}
SG{
concentration-blood-glucose{"millimole-per-liter"}
}
SI{
concentration-blood-glucose{"millimole-per-liter"}
}
SK{
concentration-blood-glucose{"millimole-per-liter"}
}
TC{
concentration-blood-glucose{"millimole-per-liter"}
}
TH{
consumption-vehicle-fuel{"liter-per-kilometer"}
pressure-baromtrc{"millibar"}
}
TO{
concentration-blood-glucose{"millimole-per-liter"}
}
TR{
consumption-vehicle-fuel{"liter-per-kilometer"}
length-person-height{"meter-and-centimeter"}
}
UA{
concentration-blood-glucose{"millimole-per-liter"}
}
UG{
concentration-blood-glucose{"millimole-per-liter"}
}
US{
area-default{
"square-mile",
"acre",
"square-foot",
"square-inch",
}
area-geograph{"square-mile"}
area-land{"acre"}
consumption-inverse-vehicle-fuel{"mile-per-gallon"}
energy-food{"foodcalorie"}
length-default{
"mile",
"foot",
"inch",
}
length-person{"inch"}
length-person-height{"inch"}
length-rainfall{"inch"}
length-snowfall{"inch"}
length-vehicle{"foot-and-inch"}
length-visiblty{
"mile",
"foot",
}
mass-default{
"ton",
"pound",
"ounce",
}
mass-person{
"pound",
"pound-and-ounce",
}
power-engine{"horsepower"}
pressure-baromtrc{"inch-ofhg"}
pressure-default{"pound-force-per-square-inch"}
speed-default{"mile-per-hour"}
speed-wind{"mile-per-hour"}
temperature-default{"fahrenheit"}
temperature-weather{"fahrenheit"}
volume-default{
"cubic-foot",
"cubic-inch",
}
volume-fluid{
"gallon",
"quart",
"pint",
"cup",
"fluid-ounce",
"tablespoon",
"teaspoon",
}
volume-vehicle{"gallon"}
}
VC{
concentration-blood-glucose{"millimole-per-liter"}
}
VG{
concentration-blood-glucose{"millimole-per-liter"}
}
VN{
concentration-blood-glucose{"millimole-per-liter"}
length-person-height{"meter-and-centimeter"}
}
VU{
concentration-blood-glucose{"millimole-per-liter"}
}
ZA{
concentration-blood-glucose{"millimole-per-liter"}
}
}
weekData{
001:intvector{
2,

File diff suppressed because it is too large Load Diff

View File

@ -109,11 +109,16 @@ public final class LdmlConverter {
"territoryContainment",
"territoryInfo",
"timeData",
"unitPreferenceData",
"weekData",
"weekOfPreference");
private static final Predicate<CldrPath> CURRENCY_DATA_PATHS =
supplementalMatcher("currencyData");
private static final Predicate<CldrPath> UNITS_DATA_PATHS =
supplementalMatcher(
"convertUnits",
"unitConstants",
"unitQuantities",
"unitPreferenceData");
private static final Predicate<CldrPath> NUMBERING_SYSTEMS_PATHS =
supplementalMatcher("numberingSystems");
private static final Predicate<CldrPath> WINDOWS_ZONES_PATHS =
@ -153,6 +158,7 @@ public final class LdmlConverter {
GENDER_LIST(SUPPLEMENTAL),
LIKELY_SUBTAGS(SUPPLEMENTAL),
SUPPLEMENTAL_DATA(SUPPLEMENTAL),
UNITS(SUPPLEMENTAL),
CURRENCY_DATA(SUPPLEMENTAL),
METADATA(SUPPLEMENTAL),
META_ZONES(SUPPLEMENTAL),
@ -472,6 +478,10 @@ public final class LdmlConverter {
processSupplemental("supplementalData", SUPPLEMENTAL_DATA_PATHS, "misc", true);
break;
case UNITS:
processSupplemental("units", UNITS_DATA_PATHS, "misc", true);
break;
case CURRENCY_DATA:
processSupplemental("supplementalData", CURRENCY_DATA_PATHS, "curr", false);
break;

View File

@ -98,11 +98,6 @@
//supplementalData/measurementData/paperSize[@type="A4"][@territories="(%W)"] ; /measurementData/$1/PaperSize:intvector ; values=297 210
//supplementalData/measurementData/paperSize[@type="US-Letter"][@territories="(%W)"] ; /measurementData/$1/PaperSize:intvector ; values=279 216
//supplementalData/unitPreferenceData/unitPreferences[@category="(%W)"][@usage="(%A)"][@scope="small"]/unitPreference[@regions="(%A)"][@alt="informal"] ; /unitPreferenceData/$3/$1-$2-small-informal
//supplementalData/unitPreferenceData/unitPreferences[@category="(%W)"][@usage="(%A)"][@scope="small"]/unitPreference[@regions="(%A)"] ; /unitPreferenceData/$3/$1-$2-small
//supplementalData/unitPreferenceData/unitPreferences[@category="(%W)"][@usage="(%A)"]/unitPreference[@regions="(%A)"][@alt="informal"] ; /unitPreferenceData/$3/$1-$2-informal
//supplementalData/unitPreferenceData/unitPreferences[@category="(%W)"][@usage="(%A)"]/unitPreference[@regions="(%A)"] ; /unitPreferenceData/$3/$1-$2
//supplementalData/territoryInfo/territory[@type="(%W)"][@gdp="(%N)"][@literacyPercent="(%N)"][@population="(%N)"]/languagePopulation[@type="(%W)"][@writingPercent="(%N)"][@populationPercent="(%N)"][@officialStatus="(%W)"](?:[@references="%W"])?
; /territoryInfo/$1/territoryF:intvector ; values=&exp($2) &exp($3,-2) &exp($4) ; base_xpath=//supplementalData/territoryInfo/territory[@type="$1"]
; /territoryInfo/$1/$5/writingShareF:int ; values=&exp($6,-2)
@ -145,6 +140,49 @@
//supplementalData/calendarData/calendar[@type="(%W)"]/eras/era[@type="(%W)"][@(start|end)="(%A)"]
; /calendarData/$1/eras/$2/$3:intvector ; values=&ymd($4)
# units.xml
//supplementalData/unitConstants/unitConstant[@constant="(%W)"][@value="(%A)"](?:[@status="%W"])?
; /unitConstants/$1 ; values="$2"
//supplementalData/unitQuantities/unitQuantity[@baseUnit="(%W)"][@quantity="(%W)"](?:[@status="%W"])?
; /unitQuantities/$1 ; values="$2"
//supplementalData/convertUnits/convertUnit[@source="(%W)"][@baseUnit="(%W)"](?:[@systems="%W"])?
; /convertUnits/$1/target ; values=$2
; /convertUnits/$1/factor ; values=1
//supplementalData/convertUnits/convertUnit[@source="(%W)"][@baseUnit="(%W)"][@factor="(%A)"](?:[@systems="%W"])?
; /convertUnits/$1/target ; values=$2
; /convertUnits/$1/factor ; values="$3"
//supplementalData/convertUnits/convertUnit[@source="(%W)"][@baseUnit="(%W)"][@offset="(%A)"](?:[@systems="%W"])?
; /convertUnits/$1/target ; values=$2
; /convertUnits/$1/factor ; values=1
; /convertUnits/$1/offset ; values=$3
//supplementalData/convertUnits/convertUnit[@source="(%W)"][@baseUnit="(%W)"][@factor="(%A)"][@offset="(%A)"](?:[@systems="%W"])?
; /convertUnits/$1/target ; values=$2
; /convertUnits/$1/factor ; values="$3"
; /convertUnits/$1/offset ; values=$4
# Quoting "$1" and "$2" in the output lets $3 expand space-separated regions: only the first unquoted output supports such expansion.
//supplementalData/unitPreferenceData/unitPreferences[@category="(%W)"][@usage="(%A)"]/unitPreference[@regions="(%A)"]
; /unitPreferenceData/"$1"/"$2"/$3/<FIFO>/unit
//supplementalData/unitPreferenceData/unitPreferences[@category="(%W)"][@usage="(%A)"]/unitPreference[@regions="(%A)"][@geq="(%A)"]
; /unitPreferenceData/"$1"/"$2"/$3/<FIFO>/unit
; /unitPreferenceData/"$1"/"$2"/$3/<FIFO>/geq ; values=$4
//supplementalData/unitPreferenceData/unitPreferences[@category="(%W)"][@usage="(%A)"]/unitPreference[@regions="(%A)"][@skeleton="(%A)"]
; /unitPreferenceData/"$1"/"$2"/$3/<FIFO>/unit
; /unitPreferenceData/"$1"/"$2"/$3/<FIFO>/skeleton ; values=$4
//supplementalData/unitPreferenceData/unitPreferences[@category="(%W)"][@usage="(%A)"]/unitPreference[@regions="(%A)"][@geq="(%A)"][@skeleton="(%A)"]
; /unitPreferenceData/"$1"/"$2"/$3/<FIFO>/unit
; /unitPreferenceData/"$1"/"$2"/$3/<FIFO>/geq ; values=$4
; /unitPreferenceData/"$1"/"$2"/$3/<FIFO>/skeleton ; values=$5
# languageInfo.xml
//supplementalData/languageMatching/languageMatches[@type="(%B)_new"]/paradigmLocales[@locales="(%A)"] ; /languageMatchingInfo/$1/paradigmLocales ; values=$2