Skip to content

Commit

Permalink
CLDR-16346 Followup to PR 2731 (#2752)
Browse files Browse the repository at this point in the history
See #2752
  • Loading branch information
macchiati authored Feb 27, 2023
1 parent 9258c90 commit c058b3a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ public class ChartLocaleGrowth {
private static final SupplementalDataInfo SUPPLEMENTAL_DATA_INFO = testInfo.getSupplementalDataInfo();

private static org.unicode.cldr.util.Factory factory = testInfo.getCommonAndSeedAndMainAndAnnotationsFactory();
private static final CLDRFile ENGLISH = factory.make("en", true);
private static final CLDRFile ENGLISH = testInfo.getEnglish();

// added info using pattern in VettingViewer.

private static final RegexLookup<Boolean> HACK = RegexLookup.<Boolean> of(LookupType.STANDARD, RegexLookup.RegexFinderTransformPath)
private static final RegexLookup<Boolean> COUNT_AS_MISSING_WHEN_ABSENT = RegexLookup.<Boolean> of(LookupType.STANDARD, RegexLookup.RegexFinderTransformPath)
.add("//ldml/localeDisplayNames/keys/key[@type=\"(d0|em|fw|i0|k0|lw|m0|rg|s0|ss|t0|x0)\"]", true)
.add("//ldml/localeDisplayNames/types/type[@key=\"(em|fw|kr|lw|ss)\"].*", true)
.add("//ldml/localeDisplayNames/languages/language[@type=\".*_.*\"]", true)
Expand Down Expand Up @@ -279,19 +279,7 @@ private static Map<String, FoundAndTotal> addGrowth(org.unicode.cldr.util.Factor
System.out.println("Can't make CLDRFile for: " + locale + "\tpast: " + mainDir);
continue;
}
// HACK check bogus
// Collection<String> extra = file.getExtraPaths();
//
// final Iterable<String> fullIterable = file.fullIterable();
// for (String path : fullIterable) {
// if (path.contains("\"one[@")) {
// boolean inside = extra.contains(path);
// Status status = new Status();
// String loc = file.getSourceLocaleID(path, status );
// int debug = 0;
// }
// }
// END HACK

Counter<Level> foundCounter = new Counter<>();
Counter<Level> unconfirmedCounter = new Counter<>();
Counter<Level> missingCounter = new Counter<>();
Expand All @@ -308,7 +296,7 @@ private static Map<String, FoundAndTotal> addGrowth(org.unicode.cldr.util.Factor
for (Entry<MissingStatus, String> e : missingPaths.keyValueSet()) {
if (e.getKey() == MissingStatus.ABSENT) {
final String path = e.getValue();
if (HACK.get(path) != null) {
if (COUNT_AS_MISSING_WHEN_ABSENT.get(path) != null) {
missingRemovals.add(e);
missingCounter.add(Level.MODERN, -1);
foundCounter.add(Level.MODERN, 1);
Expand All @@ -327,7 +315,7 @@ private static Map<String, FoundAndTotal> addGrowth(org.unicode.cldr.util.Factor
if (showMissing) {
int count = 0;
for (String s : unconfirmedPaths) {
System.out.println(++count + "\t" + locale + "\tunconfirmed\t" + s);
System.out.println(++count + "\t" + locale + "\t" + CLDRFile.DraftStatus.unconfirmed.name() +"\t" + s);
}
for (Entry<MissingStatus, String> e : missingPaths.keyValueSet()) {
String path = e.getValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,8 @@ public class ShowLocaleCoverage {
;

private static final String PROPERTIES_HEADER =
// Extra tabs are for github table formatting
"# coverageLevels.txt\n"
+ "# Copyright © 2022 Unicode, Inc.\n"
+ "# Copyright © 2023 Unicode, Inc.\n"
+ "# CLDR data files are interpreted according to the\n"
+ "# LDML specification: http://unicode.org/reports/tr35/\n"
+ "# For terms of use, see http://www.unicode.org/copyright.html\n"
Expand All @@ -111,7 +110,6 @@ public class ShowLocaleCoverage {
+ "# https://cldr.unicode.org/index/cldr-spec/coverage-levels.\n"
+ "\n"
;

private static final String TSV_MISSING_BASIC_HEADER = "#Locale\tProv.\tUnconf.\tMissing\tPath*";
private static final String TSV_MISSING_COUNTS_HEADER = "#Locale\tTargetLevel\t№ Found\t№ Unconfirmed\t№ Missing";

Expand Down

0 comments on commit c058b3a

Please sign in to comment.