Fix corpus build process

This commit is contained in:
Patrick Jentsch 2022-04-13 09:47:02 +02:00
parent 63217a7e1d
commit 43ea898394

View File

@ -875,7 +875,9 @@ class Corpus(HashidMixin, db.Model):
text_element.set('publishing_year', str(corpus_file.publishing_year)) # noqa text_element.set('publishing_year', str(corpus_file.publishing_year)) # noqa
text_element.set('school', corpus_file.school or 'NULL') text_element.set('school', corpus_file.school or 'NULL')
text_element.set('title', corpus_file.title) text_element.set('title', corpus_file.title)
corpus_element.insert(1, text_element) text_element.tail = '\n'
# corpus_element.insert(1, text_element)
corpus_element.append(text_element)
ET.ElementTree(corpus_element).write( ET.ElementTree(corpus_element).write(
os.path.join(self.path, 'cwb', 'corpus.vrt'), os.path.join(self.path, 'cwb', 'corpus.vrt'),
encoding='utf-8' encoding='utf-8'