Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 03a6e718 authored by Jérôme Euzenat's avatar Jérôme Euzenat
Browse files

- set most init interface to return the object; updated credit

parent 3a86c33c
No related branches found
No related tags found
No related merge requests found
...@@ -61,7 +61,7 @@ Raphael Voltz</dt><dd>provided some code snippets for ...@@ -61,7 +61,7 @@ Raphael Voltz</dt><dd>provided some code snippets for
<h2>Copyright owners</h2> <h2>Copyright owners</h2>
<p> <p>
Copyright (C) 2003-2012 INRIA (most of the code)<br /> Copyright (C) 2003-2014 INRIA (most of the code)<br />
Copyright (C) 2004-2005 Université de Montréal (parts of the impl/ and ling/ directories)<br /> Copyright (C) 2004-2005 Université de Montréal (parts of the impl/ and ling/ directories)<br />
Copyright (C) 2005 CNR Pisa. (parts of BasicAlignment)<br /> Copyright (C) 2005 CNR Pisa. (parts of BasicAlignment)<br />
Copyright (C) 2003 The University of Manchester (parts of the util/ directory)<br /> Copyright (C) 2003 The University of Manchester (parts of the util/ directory)<br />
......
...@@ -104,6 +104,7 @@ public class BasicAlignment implements Alignment { ...@@ -104,6 +104,7 @@ public class BasicAlignment implements Alignment {
*/ */
public void init( Object onto1, Object onto2, Object cache ) throws AlignmentException { public void init( Object onto1, Object onto2, Object cache ) throws AlignmentException {
init( onto1, onto2 ); init( onto1, onto2 );
// Should return it
} }
@SuppressWarnings( "unchecked" ) @SuppressWarnings( "unchecked" )
...@@ -115,6 +116,7 @@ public class BasicAlignment implements Alignment { ...@@ -115,6 +116,7 @@ public class BasicAlignment implements Alignment {
this.onto1.setOntology( onto1 ); this.onto1.setOntology( onto1 );
this.onto2.setOntology( onto2 ); this.onto2.setOntology( onto2 );
} }
// Should return it
} }
public static Properties getParameters() { public static Properties getParameters() {
......
...@@ -144,8 +144,10 @@ public class ExtPREvaluator extends BasicEvaluator implements Evaluator { ...@@ -144,8 +144,10 @@ public class ExtPREvaluator extends BasicEvaluator implements Evaluator {
return eval( params, (Object)null ); return eval( params, (Object)null );
} }
public double eval( Properties params, Object cache ) throws AlignmentException { public double eval( Properties params, Object cache ) throws AlignmentException {
if ( params.getProperty( "noconfidence" ) != null ) withConfidence = false; if ( params != null ) {
if ( params.getProperty( "relations" ) != null ) relsensitive = true; if ( params.getProperty( "noconfidence" ) != null ) withConfidence = false;
if ( params.getProperty( "relations" ) != null ) relsensitive = true;
}
LoadedOntology<Object> o1 = (LoadedOntology<Object>)((ObjectAlignment)align1).getOntologyObject1(); LoadedOntology<Object> o1 = (LoadedOntology<Object>)((ObjectAlignment)align1).getOntologyObject1();
LoadedOntology<Object> o2 = (LoadedOntology<Object>)((ObjectAlignment)align1).getOntologyObject2(); LoadedOntology<Object> o2 = (LoadedOntology<Object>)((ObjectAlignment)align1).getOntologyObject2();
if ( !( o1 instanceof HeavyLoadedOntology ) || !( o2 instanceof HeavyLoadedOntology ) ) if ( !( o1 instanceof HeavyLoadedOntology ) || !( o2 instanceof HeavyLoadedOntology ) )
......
...@@ -114,7 +114,7 @@ public class PRecEvaluator extends BasicEvaluator implements Evaluator { ...@@ -114,7 +114,7 @@ public class PRecEvaluator extends BasicEvaluator implements Evaluator {
public double eval( Properties params ) throws AlignmentException { public double eval( Properties params ) throws AlignmentException {
init(); init();
nbfound = align2.nbCells(); nbfound = align2.nbCells();
if ( params.getProperty("relations") != null ) relsensitive = true; if ( params != null && params.getProperty("relations") != null ) relsensitive = true;
for ( Cell c1 : align1 ) { for ( Cell c1 : align1 ) {
URI uri1 = c1.getObject2AsURI(); URI uri1 = c1.getObject2AsURI();
......
...@@ -124,9 +124,11 @@ public class SemPRecEvaluator extends PRecEvaluator implements Evaluator { ...@@ -124,9 +124,11 @@ public class SemPRecEvaluator extends PRecEvaluator implements Evaluator {
nbexpectedentailed = 0; nbexpectedentailed = 0;
nbfoundentailed = 0; nbfoundentailed = 0;
// Set the semantics to be used // Set the semantics to be used
String sem = params.getProperty( "semantics" ); if ( params != null ) {
if ( sem != null ) { String sem = params.getProperty( "semantics" );
semantics = Semantics.valueOf( sem ); if ( sem != null ) {
semantics = Semantics.valueOf( sem );
}
} }
return this; return this;
} }
......
...@@ -117,7 +117,7 @@ public class WeightedPREvaluator extends BasicEvaluator implements Evaluator { ...@@ -117,7 +117,7 @@ public class WeightedPREvaluator extends BasicEvaluator implements Evaluator {
public double eval( Properties params ) throws AlignmentException { public double eval( Properties params ) throws AlignmentException {
init(); init();
//for ( Cell c2 : align2 ) nbfound += c2.getStrength(); //for ( Cell c2 : align2 ) nbfound += c2.getStrength();
if ( params.getProperty("relations") != null ) relsensitive = true; if ( params != null && params.getProperty("relations") != null ) relsensitive = true;
for ( Cell c1 : align1 ) { for ( Cell c1 : align1 ) {
URI uri1 = c1.getObject2AsURI(); URI uri1 = c1.getObject2AsURI();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment