From 99590a158076c8fd28dfe1b6a4ca937c5901e9ba Mon Sep 17 00:00:00 2001 From: Alice BRENON <alice.brenon@ens-lyon.fr> Date: Tue, 20 Jun 2023 16:06:04 +0200 Subject: [PATCH] Clean left-overs in the code --- scripts/stanza-txt-annotator.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/stanza-txt-annotator.py b/scripts/stanza-txt-annotator.py index 2556412..12ca717 100755 --- a/scripts/stanza-txt-annotator.py +++ b/scripts/stanza-txt-annotator.py @@ -75,13 +75,11 @@ class Annotator: try: with open(outputFile, 'w') as target: for paragraph in document.split('\n\n'): - # print(f'# newpar id = {self.newpar()}', file=target) self.annotate_paragraph(paragraph, target) except Exception: print("Failed trying " + outputFile) os.unlink(outputFile) sys.exit(1) - def annotate_paragraph(self, paragraph, target): parsed = self.model(paragraph) @@ -89,6 +87,7 @@ class Annotator: print(f'# newpar id = {self.newpar()}', file=target) for sentence in parsed.sentences: print(self.annotate_sentence(sentence), file=target) + def annotate_sentence(self, sentence): return "\n".join( [f'# sent_id = {self.newsent()}', -- GitLab