Files
catena/crates/idnorm/src
funkpower da96196d98 idnorm: a DOI may have brackets in it, and usually the ones Elsevier put there
`10.1016/S0140-6736(16)30370-1` came back as `10.1016/s0140-6736` — a
different DOI, and one that resolves, so nothing downstream could tell. The
pattern excluded brackets to keep the ones a sentence wraps round a DOI, and
Elsevier alone publishes hundreds of thousands of DOIs that contain them.

Brackets are taken now, and an unbalanced closer at the end is given back:
`(10.1234/foo)` in a sentence ends on a bracket the sentence opened, and
`10.1016/S0140-6736(16)30370-1` ends on digits with a matched pair in the
middle. Counting is what tells them apart.

Found by comparing idnorm against policy-pipeline's own DOI normaliser over
229,556 real documents.
2026-09-20 15:40:24 -04:00
..