From e1b25a41d1a8f1778ef3d29777851edcfb2424a2 Mon Sep 17 00:00:00 2001 From: Lilian Gasser <gasserli@ethz.ch> Date: Thu, 28 Feb 2019 10:20:33 +0100 Subject: [PATCH] ugly workaround for Z'graggen --- src/python/utils_annot.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/python/utils_annot.py b/src/python/utils_annot.py index e714180c..6d5905be 100644 --- a/src/python/utils_annot.py +++ b/src/python/utils_annot.py @@ -444,6 +444,10 @@ def label_speechstart(XML_new, ind_p, ind_t, text, ind_tl_colon, df_names, list_ # add attribute speech_start to textbox XML_new[ind_p][ind_t].attrib['text_type'] = 'speech_start' + # MP Z'graggen causes problem in xml because of ' + if 'graggen' in str_name: + str_name = 'Zgraggen Max Johann (Basel-Stadt BS)' + # add speaker as attribute to first textline XML_new[ind_p][ind_t][0].attrib['speaker'] = (str_name, str_role, list_uniqueID, str_canton) @@ -1097,6 +1101,7 @@ def collect_info(XML_root, bln_print=False): # construct key key = '_'.join((index_page, speaker, index_start, index_end)) + # add to dictionary dict_speeches[key] = (speaker_tpl, complete_text) -- GitLab