# Path: epitator/annotator.py
# class Annotator(object):
#     def annotate(self, doc):


from .annotator import Annotator, AnnoTier, AnnoSpan
import re
import pyparsing as pypar
            else:
                row_lengths = sorted([len(row) for row in data])
                # Determine the min and max difference between any two row lengths.
                max_diff = row_lengths[-1] - row_lengths[0]
                min_diff = max_diff
                for row_len, next_row_len in zip(row_lengths, row_lengths[1:]):
                    len_diff = next_row_len - row_len
                    if len_diff < min_diff:
                        min_diff = len_diff
                if min_diff > 0 and max_diff > 1:
                    continue
            spans.append(create_trimmed_annospan_for_doc(start, end, "table", metadata={
                "type": "table",
                "data": data,
                "delimiter": next(k.split("delimiter:")[1] for k in token.keys() if k.startswith("delimiter:"))
            }))
            value_spans += new_value_spans
        for token, start, end in key_value_list_parser.scanString(doc.text):
            data = {
                create_trimmed_annospan_for_doc(key_start, key_end): create_trimmed_annospan_for_doc(value_start, value_end)
                for (((key_start, key), (key_end, _)), ((value_start, value), (value_end, _2))) in token
            }
            spans.append(create_trimmed_annospan_for_doc(start, end, "keyValuePairs", metadata={
                "type": "keyValuePairs",
                "data": data,
                "delimiter": next(k.split("delimiter:")[1] for k in token.keys() if k.startswith("delimiter:"))
            }))
            value_spans += data.values()
        return {
            'structured_data': AnnoTier(spans),

# Path: epitator/annotator.py
# class Annotator(object):
#     def annotate(self, doc):


# Path: epitator/structured_data_annotator.py
from .annotator import Annotator, AnnoTier, AnnoSpan
import re
import pyparsing as pypar

            else:
                row_lengths = sorted([len(row) for row in data])
                # Determine the min and max difference between any two row lengths.
                max_diff = row_lengths[-1] - row_lengths[0]
                min_diff = max_diff
                for row_len, next_row_len in zip(row_lengths, row_lengths[1:]):
                    len_diff = next_row_len - row_len
                    if len_diff < min_diff:
                        min_diff = len_diff
                if min_diff > 0 and max_diff > 1:
                    continue
            spans.append(create_trimmed_annospan_for_doc(start, end, "table", metadata={
                "type": "table",
                "data": data,
                "delimiter": next(k.split("delimiter:")[1] for k in token.keys() if k.startswith("delimiter:"))
            }))
            value_spans += new_value_spans
        for token, start, end in key_value_list_parser.scanString(doc.text):
            data = {
                create_trimmed_annospan_for_doc(key_start, key_end): create_trimmed_annospan_for_doc(value_start, value_end)
                for (((key_start, key), (key_end, _)), ((value_start, value), (value_end, _2))) in token
            }
            spans.append(create_trimmed_annospan_for_doc(start, end, "keyValuePairs", metadata={
                "type": "keyValuePairs",
                "data": data,
                "delimiter": next(k.split("delimiter:")[1] for k in token.keys() if k.startswith("delimiter:"))
            }))
            value_spans += data.values()
        return {
            'structured_data': AnnoTier(spans),

            'structured_data.values': AnnoTier(value_spans)