Skip to content

Commit

Permalink
CLDR-18155 Recommended edits
Browse files Browse the repository at this point in the history
  • Loading branch information
conradarcturus committed Dec 15, 2024
1 parent f14ddb5 commit f03fd8c
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 26 deletions.
4 changes: 2 additions & 2 deletions common/supplemental/likelySubtags.xml
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,6 @@ not be patched by hand, as any changes made in that fashion may be lost.
<likelySubtag from="mai" to="mai_Deva_IN"/> <!--Maithili‧?‧? ➡ Maithili‧Devanagari‧India-->
<likelySubtag from="mak" to="mak_Latn_ID"/> <!--Makasar‧?‧? ➡ Makasar‧Latin‧Indonesia-->
<likelySubtag from="man" to="man_Latn_GM"/> <!--Mandingo‧?‧? ➡ Mandingo‧Latin‧Gambia-->
<likelySubtag from="man_GN" to="man_Nkoo_GN"/> <!--Mandingo‧?‧Guinea ➡ Mandingo‧N’Ko‧Guinea-->
<likelySubtag from="man_Nkoo" to="man_Nkoo_GN"/> <!--Mandingo‧N’Ko‧? ➡ Mandingo‧N’Ko‧Guinea-->
<likelySubtag from="mas" to="mas_Latn_KE"/> <!--Masai‧?‧? ➡ Masai‧Latin‧Kenya-->
<likelySubtag from="maz" to="maz_Latn_MX"/> <!--Central Mazahua‧?‧? ➡ Central Mazahua‧Latin‧Mexico-->
Expand Down Expand Up @@ -1254,7 +1253,8 @@ not be patched by hand, as any changes made in that fashion may be lost.
<likelySubtag from="und_Narb" to="xna_Narb_SA"/> <!--?‧Old North Arabian‧? ➡ Ancient North Arabian‧Old North Arabian‧Saudi Arabia-->
<likelySubtag from="und_Nbat" to="arc_Nbat_JO"/> <!--?‧Nabataean‧? ➡ Aramaic‧Nabataean‧Jordan-->
<likelySubtag from="und_Newa" to="new_Newa_NP"/> <!--?‧Newa‧? ➡ Newari‧Newa‧Nepal-->
<likelySubtag from="und_Nkoo" to="man_Nkoo_GN"/> <!--?‧N’Ko‧? ➡ Mandingo‧N’Ko‧Guinea-->
<likelySubtag from="und_Nkoo" to="nqo_Nkoo_GN"/> <!--?‧N’Ko‧? ➡ N’Ko‧N’Ko‧Guinea-->
<likelySubtag from="und_Nkoo_GM" to="man_Nkoo_GM"/> <!--?‧N’Ko‧Gambia ➡ Mandingo‧N’Ko‧Gambia-->
<likelySubtag from="und_Nkoo_ML" to="bm_Nkoo_ML"/> <!--?‧N’Ko‧Mali ➡ Bambara‧N’Ko‧Mali-->
<likelySubtag from="und_Nshu" to="zhx_Nshu_CN"/> <!--?‧Nüshu‧? ➡ Chinese (family)‧Nüshu‧China-->
<likelySubtag from="und_Ogam" to="sga_Ogam_IE"/> <!--?‧Ogham‧? ➡ Old Irish‧Ogham‧Ireland-->
Expand Down
5 changes: 3 additions & 2 deletions common/supplemental/supplementalData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1918,7 +1918,7 @@ XXX Code for transations where no currency is involved
<language type="mai" scripts="Tirh" territories="IN NP" alt="secondary"/>
<language type="mak" scripts="Latn"/>
<language type="mak" scripts="Bugi" territories="ID" alt="secondary"/>
<language type="man" scripts="Nkoo Latn"/>
<language type="man" scripts="Latn Nkoo"/>
<language type="man" territories="GM GN" alt="secondary"/>
<language type="mas" scripts="Latn"/>
<language type="maz" scripts="Latn"/>
Expand Down Expand Up @@ -3147,7 +3147,8 @@ XXX Code for transations where no currency is involved
<territory type="GN" gdp="56660000000" literacyPercent="41" population="13986200"> <!--Guinea-->
<languagePopulation type="fr" populationPercent="27" officialStatus="official" references="R1352"/> <!--French-->
<languagePopulation type="ff" populationPercent="26"/> <!--Fula-->
<languagePopulation type="man_Nkoo" populationPercent="23"/> <!--Mandingo (N’Ko)-->
<languagePopulation type="man" populationPercent="23"/> <!--Mandingo-->
<languagePopulation type="man_Nkoo" writingPercent="5" populationPercent="23" references="R1021"/> <!--Mandingo (N’Ko)-->
<languagePopulation type="sus" populationPercent="11"/> <!--Susu-->
<languagePopulation type="nqo" populationPercent="5" references="R1286"/> <!--N’Ko-->
<languagePopulation type="kpe" populationPercent="3.8"/> <!--Kpelle-->
Expand Down
6 changes: 3 additions & 3 deletions common/testData/localeIdentifiers/likelySubtags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1575,9 +1575,9 @@ und-NP ; ne-Deva-NP ; ne ;
und-NR ; en-Latn-NR ; en-NR ;
und-NU ; en-Latn-NU ; en-NU ;
und-NZ ; en-Latn-NZ ; en-NZ ;
und-Nkoo ; man-Nkoo-GN ; man-Nkoo ; man-GN
und-Nkoo-AQ ; man-Nkoo-AQ ; ;
und-Nkoo-GN ; man-Nkoo-GN ; man-Nkoo ; man-GN
und-Nkoo ; nqo-Nkoo-GN ; nqo ;
und-Nkoo-AQ ; nqo-Nkoo-AQ ; nqo-AQ ;
und-Nkoo-GN ; nqo-Nkoo-GN ; nqo ;
und-OM ; ar-Arab-OM ; ar-OM ;
und-Olck ; sat-Olck-IN ; sat ;
und-Olck-AQ ; sat-Olck-AQ ; sat-AQ ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ public static Set<String> getAllKeysAndValues(Map<String, String> newItems) {
private static boolean handleLanguageGroups(
String value, XPathParts parts, Multimap<String, String> languageGroups) {
String parent = parts.getAttributeValue(-1, "parent");
List<String> children = SupplementalDataInfo.WHITESPACE_SPLTTER.splitToList(value);
List<String> children = SupplementalDataInfo.WHITESPACE_SPLITTER.splitToList(value);
languageGroups.putAll(parent, children);
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,6 @@ public PopulationData setWritingPopulation(double writingPopulation) {
}
}

static final Pattern WHITESPACE_PATTERN = PatternCache.get("\\s+");

/** Simple language/script/region information */
public static class BasicLanguageData
implements Comparable<BasicLanguageData>,
Expand Down Expand Up @@ -349,18 +347,17 @@ public BasicLanguageData setType(Type type) {
// Adding scripts but leaving 0 as a placeholder when there is no population data
// input: a whitespace-separated list of scripts
public BasicLanguageData setScriptsWithoutPopulation(String scriptTokens) {
List<String> scripts = new ArrayList<>();
if (scriptTokens != null) {
scripts = Arrays.asList(WHITESPACE_PATTERN.split(scriptTokens));
}
return setScriptsWithoutPopulation(scripts);
return setScriptsWithoutPopulation(
scriptTokens == null ? null : WHITESPACE_SPLITTER.splitToList(scriptTokens));
}

// Adding scripts but leaving 0 as a placeholder when there is no population data
public BasicLanguageData setScriptsWithoutPopulation(Collection<String> scripts) {
Map<String, Integer> scriptsByPopulation = new TreeMap<>();
for (String script : scripts) {
scriptsByPopulation.put(script, 0);
if (scripts != null) {
for (String script : scripts) {
scriptsByPopulation.put(script, 0);
}
}
return setScripts(scriptsByPopulation);
}
Expand All @@ -369,7 +366,7 @@ public BasicLanguageData setTerritories(String territoryTokens) {
return setTerritories(
territoryTokens == null
? null
: Arrays.asList(WHITESPACE_PATTERN.split(territoryTokens)));
: WHITESPACE_SPLITTER.splitToList(territoryTokens));
}

public BasicLanguageData setScripts(Map<String, Integer> newScripts) {
Expand All @@ -379,7 +376,9 @@ public BasicLanguageData setScripts(Map<String, Integer> newScripts) {
// TODO add error checking
scripts = Collections.emptySet();
scriptsByPopulation = new TreeMap<>();
addScripts(newScripts);
if (newScripts != null) {
addScripts(newScripts);
}
return this;
}

Expand Down Expand Up @@ -1686,7 +1685,7 @@ private boolean handleUnitPreferences(XPathValue parts, String value) {

private boolean handleLanguageGroups(String value, XPathValue parts) {
String parent = parts.getAttributeValue(-1, "parent");
List<String> children = WHITESPACE_SPLTTER.splitToList(value);
List<String> children = WHITESPACE_SPLITTER.splitToList(value);
languageGroups.putAll(parent, children);
return true;
}
Expand Down Expand Up @@ -1862,7 +1861,7 @@ private boolean handleLanguageMatcher(XPathValue parts) {
switch (parts.getElement(3)) {
case "paradigmLocales":
List<String> locales =
WHITESPACE_SPLTTER.splitToList(parts.getAttributeValue(3, "locales"));
WHITESPACE_SPLITTER.splitToList(parts.getAttributeValue(3, "locales"));
// TODO
// LanguageMatchData languageMatchData =
// languageMatchData.get(type);
Expand Down Expand Up @@ -5107,7 +5106,7 @@ public File getDirectory() {
return directory;
}

public static final Splitter WHITESPACE_SPLTTER =
public static final Splitter WHITESPACE_SPLITTER =
Splitter.on(PatternCache.get("\\s+")).omitEmptyStrings();

public static final class AttributeValidityInfo {
Expand Down Expand Up @@ -5155,7 +5154,7 @@ public AttributeValidityInfo(
this.dtds = Collections.singleton(DtdType.ldml);
} else {
Set<DtdType> temp = EnumSet.noneOf(DtdType.class);
for (String s : WHITESPACE_SPLTTER.split(dtds)) {
for (String s : WHITESPACE_SPLITTER.split(dtds)) {
temp.add(DtdType.fromElement(s));
}
this.dtds = Collections.unmodifiableSet(temp);
Expand All @@ -5164,10 +5163,10 @@ public AttributeValidityInfo(
this.elements =
elements == null
? Collections.EMPTY_SET
: With.in(WHITESPACE_SPLTTER.split(elements))
: With.in(WHITESPACE_SPLITTER.split(elements))
.toUnmodifiableCollection(new HashSet<String>());
this.attributes =
With.in(WHITESPACE_SPLTTER.split(attributes))
With.in(WHITESPACE_SPLITTER.split(attributes))
.toUnmodifiableCollection(new HashSet<String>());
this.order = order;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,8 @@ Guinea GN "11,855,411" 41% "27,970,000,000" official French fr 27.2% https://o
Guinea GN "11,855,411" 41% "27,970,000,000" Fulah ff 26%
Guinea GN "11,855,411" 41% "27,970,000,000" Fulah (Adlam) ff_Adlm 1 No Data Available at present.
Guinea GN "11,855,411" 41% "27,970,000,000" Kpelle kpe 3.8%
Guinea GN "11,855,411" 41% "27,970,000,000" Mandingo (N’Ko) man_Nkoo 23%
Guinea GN "11,855,411" 41% "27,970,000,000" Mandingo man 23%
Guinea GN "11,855,411" 41% "27,970,000,000" Mandingo (N’Ko) man_Nkoo 23% 5% Actually literacy in Nko writing unknown but historically they used the Latin script
Guinea GN "11,855,411" 41% "27,970,000,000" N’Ko nqo 5% No figures available for this language. Estimating at 5%.
Guinea GN "11,855,411" 41% "27,970,000,000" Susu sus 11%
Guinea-Bissau GW "1,833,247" 55% "3,171,000,000" Fulah ff 1 No estimate available.
Expand Down

0 comments on commit f03fd8c

Please sign in to comment.