class RemoveStopwordsTest(unittest.TestCase):
    def setUp(self):
        self.op = RemoveStopwords()

    def test_run(self):
        self.op = RemoveStopwords()
        self.test_data = []
        self.assertEqual(
            self.op.run(self.test_data),
            ['quick,', 'brown', 'fox', 'jumps', 'over', 'lazy', 'dogs'])
class RemoveStopwordsTest(unittest.TestCase):

    def setUp(self):
        self.op = RemoveStopwords()

    def test_run(self):
        self.op = RemoveStopwords()
        self.test_data = []
        self.assertEqual(self.op.run(self.test_data),
        ['quick,','brown','fox','jumps','over','lazy','dogs']
)
Example #3
0
class RemoveStopwordsTest(unittest.TestCase):
    def setUp(self):
        self.op = RemoveStopwords()

    def test_run(self):
        test_data = [
            Corpus("0", "", "the quick brown fox jumps over the lazy dog")
        ]
        test_data = WordTokenizeWhitespacePunct().run(test_data)
        desired_results = {"0": "quick brown fox jumps lazy dog"}
        results = self.op.run(test_data)
        self.assertIsNotNone(results)
        for corpus in results:
            self.assertEqual(corpus.contents, desired_results[corpus.id])