in textract-pipeline/lambda/textractor/python/trp.py [0:0]
def __init__(self, block, blockMap):
self._block = block
self._confidence = block['Confidence']
self._geometry = Geometry(block['Geometry'])
self._id = block['Id']
self._rows = []
ri = 1
row = Row()
cell = None
if('Relationships' in block and block['Relationships']):
for rs in block['Relationships']:
if(rs['Type'] == 'CHILD'):
for cid in rs['Ids']:
cell = Cell(blockMap[cid], blockMap)
if(cell.rowIndex > ri):
self._rows.append(row)
row = Row()
ri = cell.rowIndex
row.cells.append(cell)
if(row and row.cells):
self._rows.append(row)