|
|
|
@ -27,12 +27,34 @@ def export_entry(entry):
|
|
|
|
|
headword.appendChild(headword_lemma)
|
|
|
|
|
head.appendChild(headword)
|
|
|
|
|
|
|
|
|
|
# if({}) works uncorrectly in transcrypt
|
|
|
|
|
if len(entry.lexical_unit) > 0:
|
|
|
|
|
lexunit = doc.createElement("lexicalUnit")
|
|
|
|
|
lexunit.setAttribute("id", entry.lexical_unit["id"])
|
|
|
|
|
lexunit.setAttribute("type", "single")
|
|
|
|
|
lexeme = doc.createElement("lexeme")
|
|
|
|
|
lexeme.setAttribute("lexical_unit_lexeme_id", entry.lexical_unit["id"])
|
|
|
|
|
lexeme.textContent = entry.lexical_unit["text"]
|
|
|
|
|
|
|
|
|
|
lexunit.appendChild(lexeme)
|
|
|
|
|
head.appendChild(lexunit)
|
|
|
|
|
|
|
|
|
|
grammar = doc.createElement("grammar")
|
|
|
|
|
grammar_category = doc.createElement("category")
|
|
|
|
|
grammar_category.textContent = entry.grammar
|
|
|
|
|
grammar.appendChild(grammar_category)
|
|
|
|
|
head.appendChild(grammar)
|
|
|
|
|
|
|
|
|
|
if len(entry.measure) > 0:
|
|
|
|
|
measure_list = doc.createElement("measureList")
|
|
|
|
|
measure = doc.createElement("measure")
|
|
|
|
|
measure.setAttribute("source", entry.measure["source"])
|
|
|
|
|
measure.setAttribute("type", entry.measure["type"])
|
|
|
|
|
measure.textContent = entry.measure["text"]
|
|
|
|
|
|
|
|
|
|
measure_list.appendChild(measure)
|
|
|
|
|
head.appendChild(measure_list)
|
|
|
|
|
|
|
|
|
|
variants = doc.createElement("variantList")
|
|
|
|
|
head.appendChild(variants)
|
|
|
|
|
|
|
|
|
|