From 39c76f8b5ca2dd1dc0f363e1668a2773f6ff019d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Euzenat?= <Jerome.Euzenat@inria.fr> Date: Wed, 17 Oct 2012 15:16:17 +0000 Subject: [PATCH] - set the average on the actually retrieved tests - yield more succint error message when a test is not retrieved --- src/fr/inrialpes/exmo/align/cli/GroupOutput.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/fr/inrialpes/exmo/align/cli/GroupOutput.java b/src/fr/inrialpes/exmo/align/cli/GroupOutput.java index f6ff5221..49d9a19f 100644 --- a/src/fr/inrialpes/exmo/align/cli/GroupOutput.java +++ b/src/fr/inrialpes/exmo/align/cli/GroupOutput.java @@ -247,13 +247,19 @@ public class GroupOutput { public double iterateTests( String algo, int[] tests ){ File dir = (new File(System.getProperty("user.dir"))); double result = 0.0; + int nbtests = 0; for ( int i=0; i<tests.length; i++ ){//size() or length if ( debug > 1 ) System.err.println(" tests: "+tests[i]); String prefix = dir.toURI().toString()+"/"+tests[i]+"/"; try { PRecEvaluator evaluator = (PRecEvaluator)eval( prefix+"refalign.rdf", prefix+algo+".rdf"); result = result + evaluator.getFmeasure(); - } catch (AlignmentException aex ) { aex.printStackTrace(); } + nbtests++; // Only the tests that succeed + } catch ( AlignmentException aex ) { // simple error message + if ( aex.getCause() != null ) + System.err.println( aex.getCause().getMessage() ); + else System.err.println( aex ); + } } // Unload the ontologies. try { @@ -261,8 +267,7 @@ public class GroupOutput { } catch ( OntowrapException owex ) { // only report owex.printStackTrace(); } - - return result/(double)tests.length; + return result/(double)nbtests; } public Evaluator eval( String alignName1, String alignName2 ) throws AlignmentException { -- GitLab