Add logic for parsing references from last page of PDF#11156
Conversation
…FromPdfImporter) - Support more date formats - Increase log level for issues for date parsing
src/main/java/org/jabref/logic/importer/fileformat/BibliopgraphyFromPdfImporter.java
Outdated
Show resolved
Hide resolved
src/main/java/org/jabref/gui/maintable/ExtractReferencesAction.java
Outdated
Show resolved
Hide resolved
src/main/java/org/jabref/logic/importer/fileformat/BibliopgraphyFromPdfImporter.java
Outdated
Show resolved
Hide resolved
| for (BibEntry importedEntry : result.getDatabase().getEntries()) { | ||
| count++; | ||
| Optional<String> citationKey = importedEntry.getCitationKey(); | ||
| if (citationKey.isPresent()) { |
There was a problem hiding this comment.
citationKey.map(cites:add).orElseGet( () ->
There was a problem hiding this comment.
Not sure if new code is more readable --> "orElseGet" result needs to be added to the list, too. Uses outer variable "count", which is non final. I needed to wrap in anonymous object.
There was a problem hiding this comment.
then better use the original code
| // Y. Shimosaki et al., “Lattice design for 5 MeV – 125 mA CW RFQ operation in LIPAc”, in Proc. IPAC’19, Mel- bourne, Australia, May 2019, pp. 977-979. doi:10.18429/ JACoW-IPAC2019-MOPTS051 | ||
| int pos = reference.indexOf("doi:"); | ||
| if (pos >= 0) { | ||
| String doi = reference.substring(pos + 4).trim(); |
There was a problem hiding this comment.
Sure that this are always 4 characters?
There was a problem hiding this comment.
I am pretty sure that the constant string "doi:" alwas has 4 characters. But in a parallel universe this might change. Thus, I will change to "doi:'.length() later
|
You should resolve the conflicts in changelog so that the tests are running |
Example: "I. Podadera, J. M. Carmona, A. Ibarra, and J. Molla"
src/main/java/org/jabref/gui/maintable/ExtractReferencesAction.java
Outdated
Show resolved
Hide resolved
This reverts commit 7adb334.
|
The build for this PR is no longer available. Please visit https://builds.jabref.org/main/ for the latest build. |
A scientific paper has a "References" section. Especially when reviewing papers, it would be nice if all references from there would appear parsed within JabRef. This PR implements that. Thus, this PR implements #10200 via offline parsing (no online services used!), follow-up to #10437.
The parser is rule-based and uses Regular Expressions (RegEx).
How to use:
Pre Condition
Steps
Status
Mandatory checks
CHANGELOG.mddescribed in a way that is understandable for the average user (if applicable)