def testGetPhraseOffset(self): s = Sentence(TEST_TOKENS) tests = [(1, (0, 2)), (2, (3, 5)), (3, (6, 8)), (4, (9, 10))] for number, offset in tests: self.assertEqual(s.phraseOffsetFor(number), offset)