Example #1
0
 def test_deletion_interspersed(self):
     a = [('__BEGIN__', EPS_LABEL), ('f', 'f'),
          (EPS_LABEL, EPS_LABEL), ('o', EPS_LABEL),
          (EPS_LABEL, EPS_LABEL), ('o', 'o')]
     actual = list(conv_norm.revert_conversion(a, EPS_LABEL))
     expected = [('foo', 'fo')]
     self.assertEqual(actual, expected)
Example #2
0
 def test_insertion_at_beginning_with_keep(self):
     a = [('__BEGIN__', 'f'), ('o', KEEP_LABEL), ('o', KEEP_LABEL)]
     actual = list(conv_norm.revert_conversion(a, EPS_LABEL))
     expected = [('oo', 'foo')]
     self.assertEqual(actual, expected)
Example #3
0
 def test_mixed_insertion_and_deletion_with_keep(self):
     a = [('__BEGIN__', EPS_LABEL), ('f', 'o'), ('o', 'x'), ('y', 'n')]
     actual = list(conv_norm.revert_conversion(a, EPS_LABEL))
     expected = [('foy', 'oxn')]
     self.assertEqual(actual, expected)
Example #4
0
 def test_identity_with_keep(self):
     a = [('__BEGIN__', EPS_LABEL), ('f', KEEP_LABEL), ('o', KEEP_LABEL), ('o', KEEP_LABEL)]
     actual = list(conv_norm.revert_conversion(a, EPS_LABEL))
     expected = [('foo', 'foo')]
     self.assertEqual(actual, expected)