Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid replacing DOIs with shorter ones #1127

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ public String getAllBlocksClean(int toIgnore1, int toIgnore2) {
}

/*
* Try to match a DOI in the first page, independently from any preliminar
* Try to match a DOI in the first page, independently of any preliminary
* segmentation. This can be useful for improving the chance to find a DOI
* in headers or footnotes.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,9 @@ public String processingHeaderSection(GrobidAnalysisConfig config, Document doc,
// DOI pass
List<String> dois = doc.getDOIMatches();
if (isNotEmpty(dois) && dois.size() == 1) {
resHeader.setDOI(dois.get(0));
if (dois.get(0).length() > resHeader.getDOI().length()) {
resHeader.setDOI(dois.get(0));
}
}

// normalization of dates
Expand Down
Loading