예제 #1
0
    def test_count_sentences_wrong_index(self):
        s = pd.Series(["Test", "Test"], index=[5, 6])
        counted_sentences_s = nlp.count_sentences(s)
        t_different_index = pd.Series(["", ""], index=[5, 7])

        self.assertFalse(
            counted_sentences_s.index.equals(t_different_index.index))
예제 #2
0
    def test_count_sentences_index(self):
        s = pd.Series(["Test"], index=[5])
        counted_sentences_s = nlp.count_sentences(s)
        t_same_index = pd.Series([""], index=[5])

        self.assertTrue(counted_sentences_s.index.equals(t_same_index.index))
예제 #3
0
 def test_count_sentences(self):
     s = pd.Series("I think ... it counts correctly. Doesn't it? Great!")
     s_true = pd.Series(3)
     self.assertEqual(nlp.count_sentences(s), s_true)