442baa24f996bc45e04cdf40c85e0c4fe88a40f3,dh_segment/post_processing/PAGE.py,,parse_file,#Any#,517

Before Change


    page_elements = xml_page.findall("p:Page", _ns)
    // can there be multiple pages in a single XML file? -> I don"t think so
    assert len(page_elements) == 1
    return Page.from_xml(page_elements[0])


def save_baselines(filename, baselines, ratio=(1, 1), initial_shape=None):
    txt_lines = [TextLine.from_array(baseline_coords=b, id="line_{}".format(i)) for i, b in enumerate(baselines)]

After Change


    xml_page = ET.parse(filename)
    page_elements = xml_page.find("p:Page", _ns)
    metadata_et = xml_page.find("p:Metadata", _ns)
    page = Page.from_xml(page_elements)
    page.metadata = Metadata.from_xml(metadata_et)
    return page


def save_baselines(filename, baselines, ratio=(1, 1), initial_shape=None):
    txt_lines = [TextLine.from_array(baseline_coords=b, id="line_{}".format(i)) for i, b in enumerate(baselines)]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: dhlab-epfl/dhSegment
Commit Name: 442baa24f996bc45e04cdf40c85e0c4fe88a40f3
Time: 2018-07-06
Author: sofia.oliveiraares@epfl.ch
File Name: dh_segment/post_processing/PAGE.py
Class Name:
Method Name: parse_file


Project Name: dhlab-epfl/dhSegment
Commit Name: 05280120c8aae501f52f0372b7fee511dfe70dae
Time: 2018-04-19
Author: sofia.oliveiraares@epfl.ch
File Name: dh_segment/post_processing/PAGE.py
Class Name: GraphicRegion
Method Name: from_xml


Project Name: dhlab-epfl/dhSegment
Commit Name: c1ad7c951fe6bfcd708fb91db1688ccadf3b67f9
Time: 2018-04-19
Author: sofia.oliveiraares@epfl.ch
File Name: dh_segment/post_processing/PAGE.py
Class Name: GraphicRegion
Method Name: from_xml