udapi.block.ud.settranslation module

Block SetTranslation for setting of sentence-level translation (the attribute text_en for English translation) from a separate text file (one sentence per line). For example, one can export the original sentences using write.SentencesHtml, then Google-translate them in the web browser, then CTRL+C CTRL+V to a plain text editor, save them as translations.txt and import them using this block.

Usage: udapy -s ud.SetTranslation file=translations.txt < in.conllu > out.conllu

Author: Dan Zeman

class udapi.block.ud.settranslation.SetTranslation(file, overwrite=False, **kwargs)[source]

Bases: Block

Set text_en to the next available translation.

process_tree(tree)[source]

Process a UD tree