# Path: epitator/annotator.py
# class Annotator(object):
#     def annotate(self, doc):
# 
# Path: epitator/token_annotator.py
# class TokenAnnotator(Annotator):
#     def annotate(self, doc):
#         if 'spacy.tokens' not in doc.tiers:
#             doc.add_tiers(SpacyAnnotator())
#         doc.tiers['tokens'] = doc.tiers['spacy.tokens']
#         return doc


import unittest
from epitator.annotator import AnnoDoc
from epitator.token_annotator import TokenAnnotator
offsets."""
from __future__ import absolute_import


class TokenAnnotatorTest(unittest.TestCase):

    def setUp(self):
        self.annotator = TokenAnnotator()

    def test_simple_sentence(self):

        self.doc = AnnoDoc("Hi Joe.")
        self.annotator.annotate(self.doc)

        self.assertEqual(len(self.doc.tiers['tokens'].spans), 3)

        self.assertEqual(self.doc.tiers['tokens'].spans[0].text, 'Hi')
        self.assertEqual(self.doc.tiers['tokens'].spans[0].start, 0)
        self.assertEqual(self.doc.tiers['tokens'].spans[0].end, 2)

        self.assertEqual(self.doc.tiers['tokens'].spans[1].text, 'Joe')
        self.assertEqual(self.doc.tiers['tokens'].spans[1].start, 3)
        self.assertEqual(self.doc.tiers['tokens'].spans[1].end, 6)

        self.assertEqual(self.doc.tiers['tokens'].spans[2].text, '.')
        self.assertEqual(self.doc.tiers['tokens'].spans[2].start, 6)
        self.assertEqual(self.doc.tiers['tokens'].spans[2].end, 7)

    def test_initial_space(self):


# Path: epitator/annotator.py
# class Annotator(object):
#     def annotate(self, doc):
# 
# Path: epitator/token_annotator.py
# class TokenAnnotator(Annotator):
#     def annotate(self, doc):
#         if 'spacy.tokens' not in doc.tiers:
#             doc.add_tiers(SpacyAnnotator())
#         doc.tiers['tokens'] = doc.tiers['spacy.tokens']
#         return doc


# Path: tests/annotator/test_token_annotator.py
import unittest
from epitator.annotator import AnnoDoc
from epitator.token_annotator import TokenAnnotator

offsets."""
from __future__ import absolute_import


class TokenAnnotatorTest(unittest.TestCase):

    def setUp(self):
        self.annotator = TokenAnnotator()

    def test_simple_sentence(self):

        self.doc = AnnoDoc("Hi Joe.")
        self.annotator.annotate(self.doc)

        self.assertEqual(len(self.doc.tiers['tokens'].spans), 3)

        self.assertEqual(self.doc.tiers['tokens'].spans[0].text, 'Hi')
        self.assertEqual(self.doc.tiers['tokens'].spans[0].start, 0)
        self.assertEqual(self.doc.tiers['tokens'].spans[0].end, 2)

        self.assertEqual(self.doc.tiers['tokens'].spans[1].text, 'Joe')
        self.assertEqual(self.doc.tiers['tokens'].spans[1].start, 3)
        self.assertEqual(self.doc.tiers['tokens'].spans[1].end, 6)

        self.assertEqual(self.doc.tiers['tokens'].spans[2].text, '.')
        self.assertEqual(self.doc.tiers['tokens'].spans[2].start, 6)
        self.assertEqual(self.doc.tiers['tokens'].spans[2].end, 7)

    def test_initial_space(self):


        self.doc = AnnoDoc(" Hi.")