MCPcopy Create free account
hub / github.com/chatdoc-com/OCRFlux / TableTree

Class TableTree

eval/eval_table_to_html.py:13–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11
12
13class TableTree(Tree):
14 def __init__(self, tag, colspan=None, rowspan=None, content=None, *children):
15 self.tag = tag
16 self.colspan = colspan
17 self.rowspan = rowspan
18 self.content = content
19 self.children = list(children)
20
21 def bracket(self):
22 """Show tree using brackets notation"""
23 if self.tag == 'td':
24 result = '"tag": %s, "colspan": %d, "rowspan": %d, "text": %s' % \
25 (self.tag, self.colspan, self.rowspan, self.content)
26 else:
27 result = '"tag": %s' % self.tag
28 for child in self.children:
29 result += child.bracket()
30 return "{{{}}}".format(result)
31
32
33class CustomConfig(Config):

Callers 1

load_html_treeMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected