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.
|
|
|
from model.sense import Sense
|
|
|
|
from model.editable import Editable
|
|
|
|
|
|
|
|
class Entry(Editable):
|
|
|
|
def __init__(self, entry_xml):
|
|
|
|
status = entry_xml.querySelector("head status")
|
|
|
|
headword = entry_xml.querySelector("head headword lemma")
|
|
|
|
grammar = entry_xml.querySelector("head grammar category")
|
|
|
|
comment = entry_xml.querySelector("head comment")
|
|
|
|
|
|
|
|
self.status = status.textContent if status else ""
|
|
|
|
self.headword = headword.textContent if headword else ""
|
|
|
|
self.grammar = grammar.textContent if grammar else ""
|
|
|
|
self.comment = comment.textContent if comment else ""
|
|
|
|
|
|
|
|
self.senses = [Sense(sense_xml) for sense_xml in
|
|
|
|
entry_xml.querySelectorAll("body senseList sense")]
|
|
|
|
|