Exemple #1
0
def get_abstract(parsed_document: etree, alt_text: str = 'n/a') -> str:
    try:
        abstract = parsed_document.find('front/article-meta/abstract/p').text
        if abstract is None:
            abstract = ''
            for section in parsed_document.findall(
                    'front/article-meta/abstract/sec/p'):
                # for sectioned abstracts
                abstract += str(section.text)
            if abstract == '':
                abstract = alt_text
    except AttributeError:
        abstract = alt_text
    return abstract
Exemple #2
0
 def __init__(self, root: etree) -> None:
     self.mode = get_xml_attrib(root, "mode")
     self.stages = [Stage(x) for x in root.findall("stage")]
     self.session = int(root.find("session").text)
Exemple #3
0
 def __init__(self, root: etree) -> None:
     self.card = get_xml_attrib(root, "card")
     self.no = int(get_xml_attrib(root, "no"))
     self.playerinfo = Playerinfo(root.find("playerinfo"))
     self.playdata = [Playdata(x) for x in root.findall("playdata")]
Exemple #4
0
 def __init__(self, root: etree) -> None:
     self.musicids = [int(x.text) for x in root.findall("musicid")]
Exemple #5
0
 def __init__(self, root: etree) -> None:
     self.syogo = [int(x.text) for x in root.findall("syogo")]