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

RefExtract: Update eprint extraction in engine and regex #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cleggm1
Copy link
Contributor

@cleggm1 cleggm1 commented Jul 11, 2019

-update engine and regex to extract arXiv eprints from urls
-add tests related to eprints in urls

Signed-off-by: Melissa Clegg cleggm1@fnal.gov

@cleggm1 cleggm1 force-pushed the arxivurl_test branch 3 times, most recently from aa4bff8 to de51e2f Compare July 18, 2019 17:19
[\s.-]*(?P<num>\d{4})(?!\d)(?:[\s-]*V(?P<version>\d))?
\s*(?P<suffix>\[[A-Z.-]+\])? """, re.VERBOSE | re.UNICODE | re.IGNORECASE)
\s*(?P<suffix>\[[A-Z.-]+\])?
(?:\.pdf)? """, re.VERBOSE | re.UNICODE | re.IGNORECASE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is non-sensical -- I wouldn't expect a .pdf after the category, the regexp is meant to match e.g. arxiv:1103.01234v5 [hep-th], which is a common way to refer to arXiv papers.
however I don't think
http://arxiv.org/pdf/arxiv:1103.01234v5 [hep-th].pdf is a thing to look for

@@ -586,11 +586,13 @@ def add_recid_elements(splitted_citations):


def arxiv_urls_to_report_numbers(citation_elements):
arxiv_url_prefix = 'http://arxiv.org/abs/'
arxiv_url_prefix = re.compile('^https?:\/\/(?:(?:cn\.|de\.|in\.|lanl\.)?arxiv\.org|xxx\.lanl\.gov)\/(?:abs|pdf)\/(\S+\d{4})(?:v\d)?(?:\.pdf)?', re.UNICODE | re.IGNORECASE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version can be >9 e.g. v13. (?:v\d)? is not matching that

[\s.-]*(?P<num>\d{5})(?!\d)
(?:[\s-]*V(?P<version>\d))?
\s*(?P<suffix>\[[A-Z.-]+\])?
(?:\.pdf)? """, re.VERBOSE | re.UNICODE | re.IGNORECASE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as line 80

(?:https?://(?:xxx\.)?lanl\.gov/(?:abs|pdf)/)|
(?:ARXIV[\s:-]*))(?P<year>(1[3-9]|[2-8][0-9]))-?(?P<month>(0[1-9]|1[0-2]))
[\s.-]*(?P<num>\d{5})(?!\d)
(?:[\s-]*V(?P<version>\d))?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\d+ for version > 9 ?

Signed-off-by: Melissa Clegg <cleggm1@fnal.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants