Skip to content

Commit

Permalink
AnnotatedContent: add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Laura Dietz committed Jun 5, 2020
1 parent 9689956 commit 2f18760
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python3/annotated_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@
from trec_car.read_data import *

class Annotation():
"""Wraps a semantic annotation with offset information """
def __init__(self, start, end, annotation):
self.start = start
self.end = end
self.annotation = annotation

class AnnotatedContentBuilder():

"""Builds a string iteratively and keeps track of offsets.
Chunks of plain text and semantic annotations need to added in order
"""
def __init__(self):
self.content = ""
self.offset = 0
Expand All @@ -42,7 +45,7 @@ def get_annotations(self):


def annotate_section_content(section):

""" Example implementation to break out the content of a (top-level) section with entity links """
def annotated_content(skel, contentBuilder):
if isinstance(skel, Section):
contentBuilder.append('\n')
Expand Down

0 comments on commit 2f18760

Please sign in to comment.