Mentions légales du service

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

- made the StringDistanceAlignment tolerant to the absence of label

parent 940ebd85
No related branches found
No related tags found
No related merge requests found
...@@ -54,8 +54,14 @@ public class StringDistAlignment extends DistanceAlignment implements AlignmentP ...@@ -54,8 +54,14 @@ public class StringDistAlignment extends DistanceAlignment implements AlignmentP
similarity = false; // This is a distance matrix similarity = false; // This is a distance matrix
} }
public double measure( Object o1, Object o2 ) throws Exception { public double measure( Object o1, Object o2 ) throws Exception {
String s1 = ontology1().getEntityName( o1 ); String s1 = null;
String s2 = ontology2().getEntityName( o2 ); String s2 = null;
try {
s1 = ontology1().getEntityName( o1 );
s2 = ontology2().getEntityName( o2 );
} catch ( Exception owex ) { // dealt with below
if ( debug > 1 ) owex.printStackTrace();
};
// Unnamed entity = max distance // Unnamed entity = max distance
if ( s1 == null || s2 == null ) return 1.; if ( s1 == null || s2 == null ) return 1.;
Object[] params = { s1.toLowerCase(), s2.toLowerCase() }; Object[] params = { s1.toLowerCase(), s2.toLowerCase() };
......
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