|
|
|
@ -46,15 +46,17 @@ def export_entry(entry):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# if({}) works uncorrectly in transcrypt
|
|
|
|
|
if len(entry.lexical_unit) > 0:
|
|
|
|
|
if len(entry.lexical_unit) > 0 and len(entry.lexical_unit['lexemes']) > 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)
|
|
|
|
|
lexunit.setAttribute("type", entry.lexical_unit['type'])
|
|
|
|
|
for lexeme in entry.lexical_unit["lexemes"]:
|
|
|
|
|
component = doc.createElement('component')
|
|
|
|
|
lexeme_xml = doc.createElement("lexeme")
|
|
|
|
|
component.appendChild(lexeme_xml)
|
|
|
|
|
lexeme_xml.setAttribute("lexical_unit_lexeme_id", lexeme["id"])
|
|
|
|
|
lexeme_xml.textContent = lexeme["text"]
|
|
|
|
|
lexunit.appendChild(component)
|
|
|
|
|
head.appendChild(lexunit)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|