From 297eb207a5ce41335182b23422987b388b4f8a4c Mon Sep 17 00:00:00 2001 From: miconis Date: Tue, 4 Apr 2023 17:10:37 +0200 Subject: [PATCH] minor change in the author match which now can compute count and percentage --- .../src/main/java/eu/dnetlib/pace/tree/AuthorsMatch.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 6307cd576..c1b536ecd 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 @@ -26,6 +26,7 @@ public class AuthorsMatch extends AbstractComparator { private double FULLNAME_THRESHOLD; private String MODE; //full or surname private int SIZE_THRESHOLD; + private String TYPE; //count or percentage private int common; public AuthorsMatch(Map params){ @@ -37,6 +38,7 @@ public class AuthorsMatch extends AbstractComparator { NAME_THRESHOLD = Double.parseDouble(params.getOrDefault("name_th", "0.95")); FULLNAME_THRESHOLD = Double.parseDouble(params.getOrDefault("fullname_th", "0.9")); SIZE_THRESHOLD = Integer.parseInt(params.getOrDefault("size_th", "20")); + TYPE = params.getOrDefault("type", "percentage"); common = 0; } @@ -123,7 +125,12 @@ public class AuthorsMatch extends AbstractComparator { //normalization factor to compute the score int normFactor = aList.size() == bList.size() ? aList.size() : (aList.size() + bList.size() - common); - return (double)common / normFactor; + if(TYPE.equals("percentage")) { + return (double) common / normFactor; + } + else { + return (double) common; + } } public boolean compareSurname(Person p1, Person p2) {