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


import unittest
from epitator.annotator import AnnoDoc
from epitator.ne_annotator import NEAnnotator
#!/usr/bin/env python
"""Tests for the NEAnnotator that annotates a sentence with named entities."""
from __future__ import absolute_import


class NEAnnotatorTest(unittest.TestCase):

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

    def test_simple_sentence(self):

        self.doc = AnnoDoc("I'm married to Joe.")
        self.doc.add_tier(self.annotator)

        self.assertEqual(len(self.doc.tiers['nes'].spans), 1)

        self.assertEqual(self.doc.tiers['nes'].spans[0].label, 'PERSON')
        self.assertEqual(self.doc.tiers['nes'].spans[0].start, 15)
        self.assertEqual(self.doc.tiers['nes'].spans[0].end, 18)

    def test_complex_text(self):


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


# Path: tests/annotator/test_ne_annotator.py
import unittest
from epitator.annotator import AnnoDoc
from epitator.ne_annotator import NEAnnotator

#!/usr/bin/env python
"""Tests for the NEAnnotator that annotates a sentence with named entities."""
from __future__ import absolute_import


class NEAnnotatorTest(unittest.TestCase):

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

    def test_simple_sentence(self):

        self.doc = AnnoDoc("I'm married to Joe.")
        self.doc.add_tier(self.annotator)

        self.assertEqual(len(self.doc.tiers['nes'].spans), 1)

        self.assertEqual(self.doc.tiers['nes'].spans[0].label, 'PERSON')
        self.assertEqual(self.doc.tiers['nes'].spans[0].start, 15)
        self.assertEqual(self.doc.tiers['nes'].spans[0].end, 18)

    def test_complex_text(self):


        self.doc = AnnoDoc(