ropensci / bibtex

bibtex parser for R
https://docs.ropensci.org/bibtex/
35 stars 12 forks source link

List of author names joined by "AND" cannot be parsed #18

Closed crsh closed 3 years ago

crsh commented 6 years ago

If a list of authors is joined by AND rather than and the BibTeX entry cannot be parsed, as reported here.

@Article{10.1371/journal.pone.0109458,
author = {Liu, Yang-Yu AND Nacher, Jose C. AND Ochiai, Tomoshiro AND Martino, Mauro AND Altshuler, Yaniv},
journal = {PLOS ONE},
publisher = {Public Library of Science},
title = {Prospect Theory for Online Financial Trading},
year = {2014},
month = {10},
volume = {9},
url = {https://doi.org/10.1371/journal.pone.0109458},
pages = {1-7},
number = {10},
doi = {10.1371/journal.pone.0109458}
}
> bibtex::read.bib("/tmp/test.bib")
ignoring entry '10.1371/journal.pone.0109458' (line 1) because :
    Invalid author/editor format.

If I replace AND by and it works.

> bibtex::read.bib("/tmp/test.bib")
Liu Y, Nacher JC, Ochiai T, Martino M and Altshuler Y (2014).
“Prospect Theory for Online Financial Trading.” _PLOS ONE_,
*9*(10), pp. 1-7. doi: 10.1371/journal.pone.0109458 (URL:
http://doi.org/10.1371/journal.pone.0109458), <URL:
https://doi.org/10.1371/journal.pone.0109458>.
crsh commented 6 years ago

Hi @romainfrancois,

it looks to me like this could be fixed by changing the RegEx in https://github.com/romainfrancois/bibtex/blob/647d94e6db33363110234a86d76be6e346fac708/R/bibtex.R#L43 to "[[:space:]]+(and|AND)[[:space:]]+". I'd be happy to create a pull request.

That said, there has been very little activity on this repository since last year. Before I invest time: Is this package still being actively maintained?

romainfrancois commented 6 years ago

I would not qualify it actively maintained, but i will definitely review if you invest time on this.