remove unnecessary if

pull/28/head
Konstantin Baierer 4 years ago
parent 24da879844
commit 20fcac6232

@ -152,6 +152,7 @@ class EynollahXmlWriter():
if len(found_polygons_text_region) > 0: if len(found_polygons_text_region) > 0:
xml_reading_order(page, order_of_texts, id_of_texts, found_polygons_marginals) xml_reading_order(page, order_of_texts, id_of_texts, found_polygons_marginals)
for mm in range(len(found_polygons_text_region)): for mm in range(len(found_polygons_text_region)):
textregion = ET.SubElement(page, 'TextRegion') textregion = ET.SubElement(page, 'TextRegion')
textregion.set('id', counter_textregions.next_region_id) textregion.set('id', counter_textregions.next_region_id)
@ -201,7 +202,6 @@ class EynollahXmlWriter():
for _ in found_polygons_marginals: for _ in found_polygons_marginals:
id_of_marginalia.append(counter_marginals.next_region_id) id_of_marginalia.append(counter_marginals.next_region_id)
if len(found_polygons_text_region) > 0:
xml_reading_order(page, order_of_texts, id_of_texts, found_polygons_marginals) xml_reading_order(page, order_of_texts, id_of_texts, found_polygons_marginals)
for mm in range(len(found_polygons_text_region)): for mm in range(len(found_polygons_text_region)):
textregion=ET.SubElement(page, 'TextRegion') textregion=ET.SubElement(page, 'TextRegion')
@ -213,7 +213,6 @@ class EynollahXmlWriter():
add_textequiv(textregion) add_textequiv(textregion)
self.logger.debug('len(found_polygons_text_region_h) %s', len(found_polygons_text_region_h)) self.logger.debug('len(found_polygons_text_region_h) %s', len(found_polygons_text_region_h))
if len(found_polygons_text_region_h) > 0:
for mm in range(len(found_polygons_text_region_h)): for mm in range(len(found_polygons_text_region_h)):
textregion=ET.SubElement(page, 'TextRegion') textregion=ET.SubElement(page, 'TextRegion')
textregion.set('id', counter_textregions.next_region_id) textregion.set('id', counter_textregions.next_region_id)
@ -223,7 +222,6 @@ class EynollahXmlWriter():
id_indexer_l = self.serialize_lines_in_region(textregion, all_found_texline_polygons_h, mm, page_coord, all_box_coord_h, slopes, id_indexer_l) id_indexer_l = self.serialize_lines_in_region(textregion, all_found_texline_polygons_h, mm, page_coord, all_box_coord_h, slopes, id_indexer_l)
add_textequiv(textregion) add_textequiv(textregion)
if len(found_polygons_drop_capitals) > 0:
for mm in range(len(found_polygons_drop_capitals)): for mm in range(len(found_polygons_drop_capitals)):
textregion=ET.SubElement(page, 'TextRegion') textregion=ET.SubElement(page, 'TextRegion')
textregion.set('id', counter_textregions.next_region_id) textregion.set('id', counter_textregions.next_region_id)

Loading…
Cancel
Save