Skip to content

Commit

Permalink
minor fix in comment
Browse files Browse the repository at this point in the history
  • Loading branch information
rausch-supola committed Nov 15, 2024
1 parent ca9e99e commit 7dc262a
Showing 1 changed file with 10 additions and 99 deletions.
109 changes: 10 additions & 99 deletions 080_scripts_generic/080_01_ELAN2TEI/change_title.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 3,
"id": "033bf039",
"metadata": {},
"outputs": [],
"source": [
"# script for changing the title[level=\"a\"] element of the urfa files in the manannot folder\n",
"# e.g. before: URFA_011, after: Cemetry-Harran"
"# e.g. before: URFA_011, after: Cemetry Harran"
]
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 4,
"id": "eacc4409",
"metadata": {},
"outputs": [],
Expand All @@ -25,108 +25,19 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 2,
"id": "7db95eaf",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"write to file Urfa-011_Cemetry-Harran-2010.xml\n",
"write to file Urfa-012_Lentils-Harran-2010.xml\n",
"write to file Urfa-014_Village_of_Qoran-Harran-2010.xml\n",
"write to file Urfa-024a_Vegetabels_and_Seasonal_Work-Harran-2010.xml\n",
"write to file Urfa-024b_Vegetabels_and_Seasonal_Work-Harran-2010.xml\n",
"write to file Urfa-024_Vegetabels_and_Seasonal_Work-Harran-2010.xml\n",
"write to file Urfa-027_Cultivation-Harran-2010.xml\n",
"write to file Urfa-029_Smoking-Harran-2010.xml\n",
"write to file Urfa-033_Sheikh_Nifil-Harran-2010.xml\n",
"write to file Urfa-034_Liquorice-Harran-2010.xml\n",
"write to file Urfa-042_Hospitality-Harran-2010.xml\n",
"write to file Urfa-043_Truffle-Harran-2010.xml\n",
"write to file Urfa-044_Sacks-Harran-2010.xml\n",
"write to file Urfa-045_Gamra_Dariba-Harran-2010.xml\n",
"write to file Urfa-046_Game_Xwetime-Harran-2010.xml\n",
"write to file Urfa-047_Game_Qubbeya-Harran-2010.xml\n",
"write to file Urfa-048_Game_Cab-Harran-2010.xml\n",
"write to file Urfa-057_Story_of_Magician-Harran-2010.xml\n",
"write to file Urfa-061_Life_of_al-Harrani-Harran-2010.xml\n",
"write to file Urfa-068_Tribes_Armenians_Jews-Harran-2010.xml\n",
"write to file Urfa-069a_Armenians-Harran-2010.xml\n",
"write to file Urfa-069b_Arabicised_Kurds-Harran-2010.pfsx.xml\n",
"write to file Urfa-070_Hen_House-Harran-2010.xml\n",
"write to file Urfa-072_Villages-Harran-2010.xml\n",
"write to file Urfa-073_Talls_Flood-Harran-2010.xml\n",
"write to file Urfa-074_Talls_Burial_for_Children-Harran-2010.xml\n",
"write to file Urfa-075_Corn_and_Language-Harran-2010.xml\n",
"write to file Urfa-076_Bedouins-Harran-2010.xml\n",
"write to file Urfa-077a_The_Jinn-Harran-2010.xml\n",
"write to file Urfa-077b_The_Jinn-Harran-2010.xml\n",
"write to file Urfa-077c_The_Jinn-Harran-2010.xml\n",
"write to file Urfa-077d_The_Jinn-Harran-2010.xml\n",
"write to file Urfa-077e_The_Jinn-Harran-2010.xml\n",
"write to file Urfa-080_Gazelles_and-Jews-Harran-2010.xml\n",
"write to file Urfa-081_Food_in_Former_Times-Harran-2010.xml\n",
"write to file Urfa-085_The_Snake_in_the_Cistern-Harran-2010.xml\n",
"write to file Urfa-087_Smide-Harran-2010.xml\n",
"write to file Urfa-092_Sultan_Murad-Harran-2010.xml\n",
"write to file Urfa-094_Three_Advices-Harran-2010.xml\n",
"write to file Urfa-097_Three_Daughters-Harran-2010.xml\n",
"write to file Urfa-098_Young_Woman-Harran-2010.xml\n",
"write to file Urfa-105_Life_in_Former_Times-Harran-2010.xml\n",
"write to file Urfa-106_Visa_in_Ankara-Harran-2010.xml\n",
"write to file Urfa-107_Cotton_Business-Harran-2010.xml\n",
"write to file Urfa-110_Salim_az-Zir-Harran-2010.xml\n",
"write to file Urfa-112_Tall_Nasir-Harran-2010.xml\n",
"write to file Urfa-115_Camel-Harran-2010.xml\n",
"write to file Urfa-119_Engagement-Harran-2010.xml\n",
"write to file Urfa-120_Cross_Marriage-Harran-2010.xml\n",
"write to file Urfa-122_Nimrod-Harran-2010.xml\n",
"write to file Urfa-123_Stealing_Boy_P1-Harran-2010.xml\n",
"write to file Urfa-124_Stealing_Boy_P2-Harran-2010.xml\n",
"write to file Urfa-125_Coffee-Harran-2010.xml\n",
"write to file Urfa-133_Sheikh_Musa-Harran-2013.xml\n",
"write to file Urfa-135_Burglars_From_Syria-Harran-2013.xml\n",
"write to file Urfa-136_Cigkofte-Harran-2013.xml\n",
"write to file Urfa-139_Lahmacun-Harran-2013.xml\n",
"write to file Urfa-140_Biyat-Harran-2013.xml\n",
"write to file Urfa-142_Chilli_Pepper-Harran-2013.xml\n",
"write to file Urfa-144_Malfuf-Harran-2013.xml\n",
"write to file Urfa-150_Iclikofte-Harran-2014.xml\n",
"write to file Urfa-151_Ashura-Harran-2014.xml\n",
"write to file Urfa-152_Dream-Harran-2014.xml\n",
"write to file Urfa-153_Sheikh_Hasan-Harran-2014.xml\n",
"write to file Urfa-155_Childhood-Harran-2014.xml\n",
"write to file Urfa-158_Moses_and_Dog-Harran-2014.xml\n",
"write to file Urfa-160_Seyhmus-Harran-2014.xml\n",
"write to file Urfa-162_Umm_al-Qet-Harran-2014.xml\n",
"write to file Urfa-163_Quilts-Harran-2014.xml\n",
"write to file Urfa-164_Baking_Bread-Harran-2014.xml\n",
"write to file Urfa-167_Sheikh_'Nad-Harran-2014.xml\n",
"write to file Urfa-173_Woman_with_No_Lover_Short-Harran-2014.xml\n",
"write to file Urfa-175_Bastig-Harran-2014.xml\n",
"write to file Urfa-176_Condolences-Harran-2014.xml\n",
"write to file Urfa-183_Policeman_and_Carp-Harran-2014.xml\n"
]
},
{
"ename": "XMLSyntaxError",
"evalue": "xml:id : attribute value is not an NCName, line 512, column 62 (Urfa-184_Evil_Eye-Harran-2014.xml, line 512)",
"ename": "NameError",
"evalue": "name 'os' is not defined",
"output_type": "error",
"traceback": [
"Traceback \u001b[1;36m(most recent call last)\u001b[0m:\n",
"\u001b[0m File \u001b[0;32m~\\AppData\\Local\\anaconda3\\Lib\\site-packages\\IPython\\core\\interactiveshell.py:3526\u001b[0m in \u001b[0;35mrun_code\u001b[0m\n exec(code_obj, self.user_global_ns, self.user_ns)\u001b[0m\n",
"\u001b[0m Cell \u001b[0;32mIn[5], line 8\u001b[0m\n tree = etree.parse(file)\u001b[0m\n",
"\u001b[0m File \u001b[0;32msrc/lxml/etree.pyx:3541\u001b[0m in \u001b[0;35mlxml.etree.parse\u001b[0m\n",
"\u001b[0m File \u001b[0;32msrc/lxml/parser.pxi:1900\u001b[0m in \u001b[0;35mlxml.etree._parseDocument\u001b[0m\n",
"\u001b[0m File \u001b[0;32msrc/lxml/parser.pxi:1920\u001b[0m in \u001b[0;35mlxml.etree._parseFilelikeDocument\u001b[0m\n",
"\u001b[0m File \u001b[0;32msrc/lxml/parser.pxi:1814\u001b[0m in \u001b[0;35mlxml.etree._parseDocFromFilelike\u001b[0m\n",
"\u001b[0m File \u001b[0;32msrc/lxml/parser.pxi:1204\u001b[0m in \u001b[0;35mlxml.etree._BaseParser._parseDocFromFilelike\u001b[0m\n",
"\u001b[0m File \u001b[0;32msrc/lxml/parser.pxi:618\u001b[0m in \u001b[0;35mlxml.etree._ParserContext._handleParseResultDoc\u001b[0m\n",
"\u001b[0m File \u001b[0;32msrc/lxml/parser.pxi:728\u001b[0m in \u001b[0;35mlxml.etree._handleParseResult\u001b[0m\n",
"\u001b[1;36m File \u001b[1;32msrc/lxml/parser.pxi:657\u001b[1;36m in \u001b[1;35mlxml.etree._raiseParseError\u001b[1;36m\n",
"\u001b[1;36m File \u001b[1;32m~\\Shawi\\shawi-data\\010_manannot\\Urfa-184_Evil_Eye-Harran-2014.xml:512\u001b[1;36m\u001b[0m\n\u001b[1;33m <w ana=\"#anid_45763\" xml:id=\"\" join=\"rigth\">u</w>\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mXMLSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m xml:id : attribute value is not an NCName, line 512, column 62\n"
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[2], line 4\u001b[0m\n\u001b[0;32m 1\u001b[0m directory \u001b[38;5;241m=\u001b[39m \u001b[38;5;124mr\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m../../010_manannot\u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[0;32m 2\u001b[0m namespaces \u001b[38;5;241m=\u001b[39m {\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtei\u001b[39m\u001b[38;5;124m'\u001b[39m: \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mhttp://www.tei-c.org/ns/1.0\u001b[39m\u001b[38;5;124m'\u001b[39m}\n\u001b[1;32m----> 4\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m file \u001b[38;5;129;01min\u001b[39;00m os\u001b[38;5;241m.\u001b[39mlistdir(directory):\n\u001b[0;32m 5\u001b[0m filename \u001b[38;5;241m=\u001b[39m os\u001b[38;5;241m.\u001b[39mfsdecode(file)\n\u001b[0;32m 6\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m filename\u001b[38;5;241m.\u001b[39mstartswith(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mUrfa\u001b[39m\u001b[38;5;124m\"\u001b[39m):\n",
"\u001b[1;31mNameError\u001b[0m: name 'os' is not defined"
]
}
],
Expand Down

0 comments on commit 7dc262a

Please sign in to comment.