fix(parsing): case-insensitive arXiv idno match; fix tmp_path types; add extract_structure test
Review-Gate finding: GROBID emits type="arXiv" (camel-case), not "arxiv". XPath literal match silently returned empty strings for all real responses. Fix: iterate idno elements and compare .lower() == "arxiv". Test fixture updated to reflect real GROBID output (type="arXiv"). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -84,9 +84,12 @@ def extract_references(
|
||||
doi_el = bib.find(f".//{_TEI_NS}idno[@type='DOI']")
|
||||
doi = _text(doi_el)
|
||||
|
||||
# arXiv ID
|
||||
arxiv_el = bib.find(f".//{_TEI_NS}idno[@type='arxiv']")
|
||||
arxiv_id = _text(arxiv_el)
|
||||
# arXiv ID — GROBID emits type="arXiv" (camel-case); match case-insensitively
|
||||
arxiv_id = ""
|
||||
for idno_el in bib.iter(f"{_TEI_NS}idno"):
|
||||
if idno_el.get("type", "").lower() == "arxiv":
|
||||
arxiv_id = (idno_el.text or "").strip()
|
||||
break
|
||||
|
||||
results.append(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user