Exemplo n.º 1
0
    def test_contains_method(self):
        text = "text"

        token = Token(text=text,
                      init_index=0,
                      end_index=len(text) - 1,
                      tag="tag")

        # In the middle
        self.assertTrue(token.enclosing(1))

        # On the borders
        self.assertTrue(token.enclosing(0))
        self.assertFalse(token.enclosing(len(text)))