Skip to content

Commit

Permalink
Merge pull request #838 from kermitt2/prioritize_crossref_author_meta
Browse files Browse the repository at this point in the history
prefer author meta from consolidation , crossref is considered more r…
  • Loading branch information
kermitt2 committed Oct 15, 2022
2 parents 197ecd0 + 6abbd4b commit 134ac7a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions grobid-core/src/main/java/org/grobid/core/data/BiblioItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -3978,6 +3978,9 @@ public static void injectIdentifiers(BiblioItem destination, BiblioItem source)

/**
* Correct fields of the first biblio item based on the second one and the reference string
*
* @param bib extracted from document
* @param bibo fetched from metadata provider (biblioglutton, crossref..)
*/
public static void correct(BiblioItem bib, BiblioItem bibo) {
//System.out.println("correct: \n" + bib.toTEI(0));
Expand Down Expand Up @@ -4130,8 +4133,8 @@ else if (bibo.getFullAuthors().size() == 1) {
// should we also check the country ? affiliation?
if (StringUtils.isNotBlank(auto.getMiddleName()) && (StringUtils.isBlank(aut.getMiddleName())))
aut.setMiddleName(auto.getMiddleName());
if (StringUtils.isNotBlank(auto.getORCID()) && (StringUtils.isBlank(aut.getORCID())))
aut.setORCID(auto.getORCID());
// crossref is considered more reliable than PDF annotations
aut.setORCID(auto.getORCID());
}
}
}
Expand Down Expand Up @@ -4175,8 +4178,6 @@ else if (bibo.getFullAuthors().size() == 1) {
aut.setTitle(aut2.getTitle());
if (StringUtils.isBlank(aut.getSuffix()))
aut.setSuffix(aut2.getSuffix());
if (StringUtils.isBlank(aut.getORCID()))
aut.setORCID(aut2.getORCID());
if (StringUtils.isBlank(aut.getEmail()))
aut.setEmail(aut2.getEmail());
if(!CollectionUtils.isEmpty(aut2.getAffiliations()))
Expand All @@ -4189,6 +4190,7 @@ else if (bibo.getFullAuthors().size() == 1) {
aut.setMarkers(aut2.getMarkers());
if (!CollectionUtils.isEmpty(aut2.getLayoutTokens()))
aut.setLayoutTokens(aut2.getLayoutTokens());
// crossref is considered more reliable than PDF annotations, so ORCIDs are not overwritten
break;
}
}
Expand Down

0 comments on commit 134ac7a

Please sign in to comment.