e3d04b13aed7abcfab08449618aacece0e6e22a0,scripts/convert_formulas.py,,get_formulas_from_xml,#Any#,19

Before Change


DOCS=None

def get_formulas_from_xml(doc):
    formulas = [s.get("sem", None) for s in doc.xpath(
        "./sentences/sentence/semantics[1]/span[1]")]
    formulas = [f for f in formulas if f is not None]
    return formulas

def main(args = None):
    global ARGS

After Change


    formulas = []
    for f in doc.xpath("./sentences/sentence"):
        if f.xpath("semantics"):
            s = f.xpath("semantics")[0]
            if s.get("status") == "success":
                formulas += s.xpath("span[1]/@sem")
            else:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: mynlp/ccg2lambda
Commit Name: e3d04b13aed7abcfab08449618aacece0e6e22a0
Time: 2019-04-21
Author: mineshima.koji@ocha.ac.jp
File Name: scripts/convert_formulas.py
Class Name:
Method Name: get_formulas_from_xml


Project Name: mynlp/ccg2lambda
Commit Name: 83e3c6a5607103193850086933b2c0e63f698366
Time: 2016-04-01
Author: pascual@nii.ac.jp
File Name: knowledge.py
Class Name:
Method Name: get_tokens_from_ccg_tree


Project Name: mynlp/ccg2lambda
Commit Name: 83e3c6a5607103193850086933b2c0e63f698366
Time: 2016-04-01
Author: pascual@nii.ac.jp
File Name: semantic_types.py
Class Name:
Method Name: merge_dynamic_libraries