diff --git a/scripts/stanza-txt-annotator.py b/scripts/stanza-txt-annotator.py index 255641219f70c19d3cf45d6efd3ab4940f908b29..12ca717e9904dc81dd8141433fe0421e4bbe94f0 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()}',