Browse Source

Merge branch 'master' into lk-collocations-feature

pull/8/head
Luka Kavčič 1 year ago
parent
commit
0b2bf53a6f
  1. 13
      src/export.py

13
src/export.py

@ -57,17 +57,12 @@ def export_entry(entry):
lexunit.appendChild(lexeme)
head.appendChild(lexunit)
# Example of keeping original xml and adding changes to it only
grammar_category = entry.original_xml.querySelector("head grammar category")
if grammar_category is None:
grammar = doc.createElement("grammar")
grammar_category = doc.createElement("category")
grammar.appendChild(grammar_category)
entry.original_xml.querySelector("head").appendChild(grammar_category)
grammar = doc.createElement("grammar")
grammar_category = doc.createElement("category")
grammar_category.textContent = entry.grammar
head.appendChild(entry.original_xml.querySelector("head grammar"))
grammar.appendChild(grammar_category)
head.appendChild(grammar)
if len(entry.measure) > 0:

Loading…
Cancel
Save