def test_docfreq(self): with captured_output() as (out, _, _): dump_model(self._get_args(input=paths.DOCFREQ)) self.assertEqual(out.getvalue()[:len(self.DOCFREQ_DUMP)], self.DOCFREQ_DUMP) ending = "\nNumber of documents: 1000\n" self.assertEqual(out.getvalue()[-len(ending):], ending)
def test_id2vec(self): with captured_output() as (out, _, _): dump_model(self._get_args(input=paths.ID2VEC)) self.assertEqual(out.getvalue(), self.ID2VEC_DUMP)
def test_coocc(self): with captured_output() as (out, _, _): dump_model(self._get_args(input=paths.COOCC)) self.assertEqual(out.getvalue(), self.COOCC_DUMP)
def test_bow(self): with captured_output() as (out, _, _): dump_model(self._get_args(input=paths.BOW)) self.assertEqual(out.getvalue(), self.BOW_DUMP)