コード例 #1
0
 def test_should_append_token_and_update_its_position(self):
     sample = Sample("xxx")
     token = Token("yyy", original="bla")
     sample.append(token)
     self.assertIn(token, sample)
     self.assertEqual(token.parent, sample)
     other_token = Token("zzz", original="bleh")
     sample.append(other_token)
     self.assertIn(other_token, sample)
     self.assertEqual(other_token.parent, sample)
     self.assertEqual(other_token.position, 1)
コード例 #2
0
ファイル: token.py プロジェクト: quatre/sulci
 def setUp(self):
     sentence = Sample("sample")
     self.first = Token("one", "Une")
     sentence.append(self.first)
     self.second = Token("two", "phrase")
     sentence.append(self.second)
     self.third = Token("three", "simple")
     sentence.append(self.third)
コード例 #3
0
 def setUp(self):
     sentence = Sample("sample")
     self.first = Token("one", "Une")
     sentence.append(self.first)
     self.second = Token("two", "phrase")
     sentence.append(self.second)
     self.third = Token("three", "simple")
     sentence.append(self.third)