You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_processor.py 433 B

123456789101112
  1. import unittest
  2. from fastNLP.api.processor import FullSpaceToHalfSpaceProcessor
  3. from fastNLP.core.dataset import DataSet
  4. class TestProcessor(unittest.TestCase):
  5. def test_FullSpaceToHalfSpaceProcessor(self):
  6. ds = DataSet({"word": ["00, u1, u), (u2, u2"]})
  7. proc = FullSpaceToHalfSpaceProcessor("word")
  8. ds = proc(ds)
  9. self.assertTrue(ds.field_arrays["word"].content, ["00, u1, u), (u2, u2"])