Skip to content

Commit

Permalink
Bugfixes in Infobox
Browse files Browse the repository at this point in the history
InfoBox did not implement get_text(): It is now implemented by returning an empty string, to exhibit backwards compatible behavior.
  • Loading branch information
Laura Dietz committed May 22, 2020
1 parent 6069e0e commit 7481dd1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions python3/read_data_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
headings = p.nested_headings()
print("headings", [section.heading for (section, content) in headings])

print("sections with content: ")
for (section, _) in headings:
if section:
print (section.get_text())

if len(p.outline())>0:
print( p.outline()[0].__str__())

Expand Down
3 changes: 2 additions & 1 deletion python3/trec_car/read_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,8 @@ def __init__(self, infobox_type, entries):
def __str__(self):
return self.title+ "\n"+ ("\n".join([key+": "+str(values) for (key,values) in self.entries]))


def get_text(self):
return ""

class Paragraph(object):
"""
Expand Down

0 comments on commit 7481dd1

Please sign in to comment.