Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLDR-17583 v46 BRS Births, part 2 #3725

Merged
merged 1 commit into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,11 @@ public static void main(String[] args) throws IOException {

String logDirectory = myOptions.get("log").getValue();

System.out.println("en");
System.out.println("en\tBegin");
Births english = new Births("en");
english.writeBirth(logDirectory, "en", null);
english.writeBirthValues(dataDirectory + "/" + OutdatedPaths.OUTDATED_ENGLISH_DATA);
String englishDataFile = dataDirectory + "/" + OutdatedPaths.OUTDATED_ENGLISH_DATA;
english.writeBirthValues(englishDataFile);

Map<Long, Pair<CldrVersion, String>> pathToPrevious = new HashMap<>();

Expand Down Expand Up @@ -194,8 +195,9 @@ public static void main(String[] args) throws IOException {
if (!ltp.set(fileName).getRegion().isEmpty()) {
continue; // skip region locales
}
// TODO skip default content locales
System.out.println(fileName);
// TODO skip default content
System.out.println();
System.out.println(fileName + "\t" + "Begin");
Births other = new Births(fileName);
Set<String> newer = other.writeBirth(logDirectory, fileName, english);

Expand Down Expand Up @@ -254,11 +256,15 @@ public static void main(String[] args) throws IOException {
}
}
}
// give a reminder since the above will be lost
System.out.println("Wrote: " + englishDataFile);
if (errorCount != 0) {
throw new IllegalArgumentException("Done, but " + errorCount + " errors");
throw new IllegalArgumentException(
"Done, but " + errorCount + " errors writing to " + outputDataFile);
} else {
System.out.println("Done, no errors");
System.out.println("Done, no errors writing to: " + outputDataFile);
}
System.out.println("Please commit the above two files and start a PR.");
}

static class Births {
Expand All @@ -277,20 +283,21 @@ static class Births {
DisplayAndInputProcessor[] processors = new DisplayAndInputProcessor[factories.length];

for (int i = 0; i < factories.length; ++i) {
final CldrVersion ver = CldrVersion.CLDR_VERSIONS_DESCENDING.get(i);
try {
files[i] = factories[i].make(file, USE_RESOLVED);
processors[i] = new DisplayAndInputProcessor(files[i], false);
} catch (Exception e) {
// stop when we fail to find
} catch (SimpleFactory.NoSourceDirectoryException nsd) {
// stop when we fail to find a dir
System.out.println(
"Stopped at "
+ file
+ ", "
+ CldrVersion.CLDR_VERSIONS_DESCENDING.get(i));
// e.printStackTrace();
String.format("%s\tEnd of source directories at v%s", file, ver));
break;
} catch (Throwable t) {
throw new RuntimeException(
"Exception while processing " + file + " v" + ver, t);
}
}
System.out.println(String.format("%s\tDone", file));
birthToPaths = Relation.of(new TreeMap<CldrVersion, Set<String>>(), TreeSet.class);
pathToBirthCurrentPrevious = new HashMap<>();
for (String xpath : files[0]) {
Expand Down
Binary file not shown.
Binary file not shown.
Loading