def __init__(self, elems):
        """
        Constructor
        """
        if not isinstance(elems, list):
            elems = [elems]
        self.elems = elems
        self.sum_elem_bbox = 0
        for elem in elems:
            self.sum_elem_bbox = self.sum_elem_bbox + abs(
                (elem.bbox[0] - elem.bbox[2]) * (elem.bbox[1] - elem.bbox[3])
            )
        #     # self.sum_elem_bbox = self.sum_elem_bbox + len(elem.get_text())
        self.table_area_threshold = 0.7
        self.set_bbox(bound_elems(elems))
        # self.table_indicator = True
        self.type_counts = Counter(map(elem_type, elems))
        if elem_type(elems) not in ["figure", "unknown"]:
            self.feat_counts = Counter(
                kv for e in elems for kv in six.iteritems(e.feats)
            )
        else:
            self.feat_counts = 0
        self.type = "UNK"
def __init__ ( self , elems ) : if not isinstance ( elems , list ) : elems = [ elems ] self . elems = elems self . sum_elem_bbox = 0 for elem in elems : self . sum_elem_bbox = self . sum_elem_bbox + abs ( ( elem . bbox [ 0 ] - elem . bbox [ 2 ] ) * ( elem . bbox [ 1 ] - elem . bbox [ 3 ] ) ) self . table_area_threshold = 0.7 self . set_bbox ( bound_elems ( elems ) ) self . type_counts = Counter ( map ( elem_type , elems ) ) if elem_type ( elems ) not in [ "figure" , "unknown" ] : self . feat_counts = Counter ( kv for e in elems for kv in six . iteritems ( e . feats ) ) else : self . feat_counts = 0 self . type = "UNK"
Constructor