From 2ff97781d253851c2f413e2cf9e98e32e097827b Mon Sep 17 00:00:00 2001 From: miconis Date: Thu, 13 Jan 2022 17:20:20 +0100 Subject: [PATCH] minor change --- .../java/eu/dnetlib/pace/tree/AuthorsMatch.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/dnet-pace-core/src/main/java/eu/dnetlib/pace/tree/AuthorsMatch.java b/dnet-pace-core/src/main/java/eu/dnetlib/pace/tree/AuthorsMatch.java index b5a56f6a4f..afd86afec5 100644 --- a/dnet-pace-core/src/main/java/eu/dnetlib/pace/tree/AuthorsMatch.java +++ b/dnet-pace-core/src/main/java/eu/dnetlib/pace/tree/AuthorsMatch.java @@ -60,7 +60,10 @@ public class AuthorsMatch extends AbstractComparator { //both persons are inaccurate if (!p1.isAccurate() && !p2.isAccurate()) { //compare just normalized fullnames - if (ssalgo.score(normalization(p1.getNormalisedFullname()), normalization(p2.getNormalisedFullname())) > FULLNAME_THRESHOLD) { + String fullname1 = normalization(p1.getNormalisedFullname().isEmpty()? p1.getOriginal() : p1.getNormalisedFullname()); + String fullname2 = normalization(p2.getNormalisedFullname().isEmpty()? p2.getOriginal() : p2.getNormalisedFullname()); + + if (ssalgo.score(fullname1, fullname2) > FULLNAME_THRESHOLD) { common += 1; break; } @@ -69,10 +72,12 @@ public class AuthorsMatch extends AbstractComparator { //one person is inaccurate if (p1.isAccurate() ^ p2.isAccurate()) { //prepare data - String name = p1.isAccurate()? normalization(p1.getNormalisedFirstName()) : normalization(p2.getNormalisedFirstName()); - String surname = p1.isAccurate()? normalization(p2.getNormalisedSurname()) : normalization(p2.getNormalisedSurname()); + String name = normalization(p1.isAccurate()? p1.getNormalisedFirstName() : p2.getNormalisedFirstName()); + String surname = normalization(p1.isAccurate()? p2.getNormalisedSurname() : p2.getNormalisedSurname()); - String fullname = p1.isAccurate()? normalization(p2.getNormalisedFullname()) : normalization(p1.getNormalisedFullname()); + String fullname = normalization( + p1.isAccurate() ? ((p1.getNormalisedFullname().isEmpty()) ? p1.getOriginal() : p1.getNormalisedFullname()) : (p2.getNormalisedFullname().isEmpty() ? p2.getOriginal() : p2.getNormalisedFullname()) + ); if (fullname.contains(surname)) { if (MODE.equals("full")) {