From 1a695d0fe727c7df60fe0fd595999c8f987e8238 Mon Sep 17 00:00:00 2001 From: Christian Boulanger <boulanger@lhlt.mpg.de> Date: Thu, 19 Sep 2024 14:50:23 +0200 Subject: [PATCH] add <DOI> -> <idno> --- convert-anystyle-data/anystyle-to-tei.ipynb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/convert-anystyle-data/anystyle-to-tei.ipynb b/convert-anystyle-data/anystyle-to-tei.ipynb index e09eb82..6f041fd 100644 --- a/convert-anystyle-data/anystyle-to-tei.ipynb +++ b/convert-anystyle-data/anystyle-to-tei.ipynb @@ -375,8 +375,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2024-08-22T12:45:14.058291Z", - "start_time": "2024-08-22T12:45:13.744822Z" + "end_time": "2024-09-19T10:28:29.650238Z", + "start_time": "2024-09-19T10:28:28.969477700Z" } }, "cell_type": "code", @@ -580,7 +580,7 @@ " or (tag in [\"author\", \"editor\", \"authority\"] and bibl.find('date'))): # or specific tags follow a date field \n", " # then create a new bibl element\n", " bibl = ET.SubElement(node, 'bibl')\n", - " match tag:\n", + " match tag.lower():\n", " case 'author':\n", " split_creators(text, bibl, 'author', clean_func=remove_punctuation, preserve=preserve)\n", " case 'authority':\n", @@ -593,6 +593,8 @@ " add_node(bibl, 'title', text, {'level': 's'}, clean_func= clean_container, preserve=preserve)\n", " case 'date':\n", " add_node(bibl, 'date', text, clean_func= extract_year, preserve=preserve)\n", + " case 'doi':\n", + " add_node(bibl, 'idno', text, {'type':'DOI'})\n", " case 'edition':\n", " add_node(bibl, 'edition', text, clean_func=remove_punctuation2, preserve=preserve)\n", " case 'editor':\n", @@ -667,7 +669,7 @@ ] } ], - "execution_count": 24 + "execution_count": 1 }, { "cell_type": "markdown", -- GitLab