first commit

This commit is contained in:
2019-11-05 22:18:20 +01:00
commit 1699990c02
22 changed files with 633 additions and 0 deletions

17
src/model/entry.py Normal file
View File

@@ -0,0 +1,17 @@
from model.sense import Sense
class Entry:
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")]