コード例 #1
0
 def test_remove_stopwords_return_string(self):
     cl = Cleaners()
     clean = cl.remove_stopwords(['mina', 'olen', 'pikk', 'poiss'],
                                 stopwords=['olen'],
                                 return_string=True)
     self.assertEqual(clean, 'mina pikk poiss')
コード例 #2
0
 def test_remove_stopwords_default(self):
     cl = Cleaners('tests/stopwords/stopwords.txt')
     clean = cl.remove_stopwords(['yes', 'very', 'no'], return_string=True)
     self.assertEqual(clean, 'very')
コード例 #3
0
 def test_remove_stopwords_return_list(self):
     cl = Cleaners()
     clean = cl.remove_stopwords(['mina', 'olen', 'pikk', 'poiss'],
                                 stopwords=['olen'])
     self.assertEqual(clean, ['mina', 'pikk', 'poiss'])