def test_corpus_stop_list_zou(self): """Test production of stoplists from a corpus, using basis: zou""" target_list = ['ac', 'atque', 'cum', 'et', 'in', 'mihi', 'neque', 'qui', 'rerum', 'vel'] S = CorpusStoplist('latin') stoplist = S.build_stoplist(self.test_corpus, size=10,basis='zou') self.assertEqual(stoplist, target_list)
def test_corpus_stop_list_freq_sort_words(self): """Test production of stoplists from a corpus, using basis: frequency""" target_list = ['in', 'et', 'vel', 'ac', 'cum', 'qui', 'atque', 'mihi', 'ad', 'neque'] S = CorpusStoplist('latin') stoplist = S.build_stoplist(self.test_corpus, size=10, basis='frequency', sort_words=False) self.assertEqual(stoplist, target_list)