Exemple #1
0
    def test_UnwantedCharacterStripping(self):
        text = """Holding it between his finger and thumb, he said--or rather shouted, so angry was he--"Who
are you, pray, you wretched little
creature, that you make so free with , my person?"""

        new_text = preprocess_sentence(text)
        self.assertEqual(new_text, 'Holding it between his finger and thumb he said or rather shouted so angry was he Who are you pray you wretched little creature that you make so free with my person')
Exemple #2
0
 def test_PresentProgressive_2(self):
     text = "He isn't working now at all"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "working", 0), Tenses.present)
Exemple #3
0
 def test_Future(self):
     text = "He is going to visit"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "visit", 0), Tenses.future)
Exemple #4
0
 def test_WillFuture(self):
     text = "He won't work"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "work", 0), Tenses.future)
Exemple #5
0
 def test_PastPerfectProgressive_2(self):
     text = "Had I been going?"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "going", 0), Tenses.past)
Exemple #6
0
 def test_SimplePastPerfect_4(self):
     text = "Had he gone already?"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "gone", 0), Tenses.past)
Exemple #7
0
 def test_SimplePastPerfect_2(self):
     text = "I hadn't worked already"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "worked", 0), Tenses.past)
Exemple #8
0
 def test_PresentPerfectProgressive_5(self):
     text = "Has he been going?"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "going", 0), Tenses.present)
Exemple #9
0
 def test_SimplePast_3(self):
     text = "Last wednesday I didn't work at the cinema"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "work", 0), Tenses.past)
Exemple #10
0
 def test_SimplePast_2(self):
     text = "He didn't work yesterday"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "work", 0), Tenses.past)
Exemple #11
0
 def test_SimplePast(self):
     text = "He went to America in 1990"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "went", 0), Tenses.past)
Exemple #12
0
 def test_Present_2(self):
     text = "among some Reeds growing by the"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "growing", 0), Tenses.present)
Exemple #13
0
 def test_Present_2(self):
     text = "Observing it to"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "observing", 0), Tenses.present)
Exemple #14
0
 def test_Present(self):
     text = "Coming and standing under the"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "coming", 0), Tenses.present)
Exemple #15
0
 def test_PresentProgressive_3(self):
     text = "I'm not going"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "going", 0), Tenses.present)
Exemple #16
0
 def test_PresentPerfectProgressive_3(self):
     text = "I haven't been working for a long time"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "working", 0), Tenses.present)
Exemple #17
0
 def test_PresentPerfectProgressive_4(self):
     text = "He has been working since yesterday"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "working", 0), Tenses.present)
Exemple #18
0
 def test_PastProgressive(self):
     text = "While I was doing my homework"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "doing", 0), Tenses.past)
Exemple #19
0
 def test_SimplePastPerfect(self):
     text = "She never had gone there"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "gone", 0), Tenses.past)
Exemple #20
0
 def test_PastProgressive_3(self):
     text = "He wasn't going"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "going", 0), Tenses.past)
Exemple #21
0
 def test_SimplePastPerfect_3(self):
     text = "He just had gone"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "gone", 0), Tenses.past)
Exemple #22
0
 def test_SimplePresentPerfect(self):
     text = "I have gone already"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "gone", 0), Tenses.present)
Exemple #23
0
 def test_PastPerfectProgressive(self):
     text = "I had been working"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "working", 0), Tenses.past)
Exemple #24
0
 def test_SimplePresentPerfect_2(self):
     text = "He hasn't gone so far"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "gone", 0), Tenses.present)
Exemple #25
0
 def test_PastPerfectProgressive_3(self):
     text = "He had been going for 2 hours"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "going", 0), Tenses.past)
Exemple #26
0
 def test_SimplePresentPerfect_3(self):
     text = "I haven't worked ever"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "worked", 0), Tenses.present)
Exemple #27
0
 def test_WillFuture_3(self):
     text = "Will he go?"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "go", 0), Tenses.future)
Exemple #28
0
 def test_SimplePresentPerfect_4(self):
     text = "I haven't seen him for a while now"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "seen", 0), Tenses.present)
Exemple #29
0
 def test_PresentPerfectProgressive(self):
     text = "I have been working all day"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "working", 0), Tenses.present)
Exemple #30
0
 def test_PresentProgressive(self):
     text = "I'm working at the moment"
     text = preprocess_sentence(text)
     self.assertEqual(get_tense(text, "working", 0), Tenses.present)