You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
765 B
20 lines
765 B
from model.editable import Editable
|
|
from model.translation import from_container_list
|
|
|
|
class Example(Editable):
|
|
def __init__(self, example_xml):
|
|
# example = example_xml.querySelector("example")
|
|
# self.example = example.textContent if example else ""
|
|
|
|
ce_xml = example_xml.querySelector("corpusExample")
|
|
if ce_xml is not None:
|
|
self.example_type = "corpus"
|
|
inner_xml = ce_xml
|
|
else:
|
|
self.example_type = "multiword"
|
|
inner_xml = example_xml.querySelector("multiwordExample")
|
|
|
|
self.original_xml = inner_xml
|
|
self.text = inner_xml.textContent
|
|
self.translations = from_container_list(example_xml.querySelectorAll("translationContainer"))
|