in src-python/trp/__init__.py [0:0]
def _parse(self, blockMap):
for item in self._blocks:
if item["BlockType"] == "PAGE":
self._geometry = Geometry(item['Geometry'])
self._id = item['Id']
if "Custom" in item:
self._custom = item["Custom"]
elif item["BlockType"] == "LINE":
l = Line(item, blockMap)
self._lines.append(l)
self._content.append(l)
self._text = self._text + l.text + '\n'
elif item["BlockType"] == "TABLE":
t = Table(item, blockMap)
self._tables.append(t)
self._content.append(t)
elif item["BlockType"] == "KEY_VALUE_SET":
if 'KEY' in item['EntityTypes']:
f = Field(item, blockMap)
if (f.key):
self._form.addField(f)
self._content.append(f)
else:
logger.info(
f"INFO: Detected K/V where key does not have content. Excluding key from output. {f} - {item}"
)