@@ -43,19 +43,23 @@ public static void main(String[] args) {
4343 unitsToCheck .stream ()
4444 .filter (u -> !globalData .correctUnits .contains (u ))
4545 .forEach (unit -> checkUnit (unit , globalData , ttlPrintStream ));
46- System .out .println (
47- String .format (
48- "was incorrect: \n %s\n " ,
49- globalData .wasIncorrect .stream ()
50- .map (Unit ::getIriAbbreviated )
51- .collect (Collectors .joining ("\n " ))));
52- System .out .println (
53- String .format (
54- "was missing: \n %s\n " ,
55- globalData .wasMissing .stream ()
56- .map (Unit ::getIriAbbreviated )
57- .collect (Collectors .joining ("\n " ))));
5846 }
47+ System .out .println (
48+ String .format (
49+ "# %d Units with incorrect symbol: \n %s\n " ,
50+ globalData .wasIncorrect .size (),
51+ globalData .wasIncorrect .stream ()
52+ .sorted (Comparator .comparing (Unit ::getIriLocalname ))
53+ .map (Unit ::getIriAbbreviated )
54+ .collect (Collectors .joining ("\n # " , "\n # " , "\n " ))));
55+ System .out .println (
56+ String .format (
57+ "# %d Units without symbol: \n %s\n " ,
58+ globalData .wasMissing .size (),
59+ globalData .wasMissing .stream ()
60+ .sorted (Comparator .comparing (Unit ::getIriLocalname ))
61+ .map (Unit ::getIriAbbreviated )
62+ .collect (Collectors .joining ("\n # " , "\n #" , "\n " ))));
5963 });
6064 globalData .missingData .entrySet ().stream ()
6165 .sorted (
@@ -84,7 +88,7 @@ private static Predicate<Unit> isLikelyDerivedUnit() {
8488 }
8589
8690 private static void printStatements (ByteArrayOutputStream ttlOut ) {
87- System .out .println ("STATEMENTS TO ADD:\n \n " );
91+ System .out .println ("# STATEMENTS TO ADD:\n \n " );
8892 System .out .println (ttlOut .toString ());
8993 }
9094
@@ -107,24 +111,24 @@ private static void checkUnit(Unit unit, GlobalData globalData, PrintStream ttlP
107111 if (!globalData .trustCalculationForUnit (unit )) {
108112 return ;
109113 }
110- Optional <String > calculatedSymbol =
111- unit .getSymbol ().or (() -> unit .getFactorUnits ().getSymbol ());
114+ Optional <String > calculatedSymbol = unit .getFactorUnits ().getSymbol ();
112115 if (calculatedSymbol .isEmpty ()) {
113116 return ;
114117 } else {
115118 if (unit .getSymbol ().isPresent ()) {
116119 String actualSymbol = unit .getSymbol ().get ();
117- globalData .correctUnits .add (unit );
118120 boolean isRelevantDifference = !actualSymbol .equals (calculatedSymbol .get ());
119121 if (isRelevantDifference ) {
120122 commentsForTTl .println (
121123 format (
122- "WRONG SYMBOL? : %s - calculated from factors: %s, actual: %s\n " ,
124+ "WRONG SYMBOL : %s - calculated from factors: %s, actual: %s\n " ,
123125 unit .getIriAbbreviated (),
124126 calculatedSymbol .get ().toString (),
125127 actualSymbol .toString ()));
126- commentsForTTl .println ("Here is the triple you might want to use instead:" );
127- printSymbolTriple (commentsForTTl , commentsForTTl , unit , calculatedSymbol .get ());
128+ printSymbolTriple (ttlPrintStream , commentsForTTl , unit , calculatedSymbol .get ());
129+ globalData .wasIncorrect .add (unit );
130+ } else {
131+ globalData .correctUnits .add (unit );
128132 }
129133 } else {
130134 commentsForTTl .println (
0 commit comments