Beispiel #1
0
    def test_get_be_verb_present_tense_I(self):
        first_person = [
            Pronoun.I, Pronoun.ME, CapitalPronoun.I, CapitalPronoun.ME
        ]
        for subj in first_person:
            sentence = Sentence([subj, Verb('go')])
            self.assertEqual(get_be_verb(sentence), BeVerb.AM)

            sentence = Sentence([subj, Verb('go').negative()])
            self.assertEqual(get_be_verb(sentence), BeVerb.AM_NOT)
Beispiel #2
0
    def test_get_be_verb_past_tense_plural_subject(self):
        plural_subj = [
            Noun('cat').plural(),
            Noun.proper_noun('the Joes', plural=True), Pronoun.YOU,
            CapitalPronoun.YOU, Pronoun.WE, Pronoun.US, CapitalPronoun.WE,
            CapitalPronoun.US, Pronoun.THEY, Pronoun.THEM, CapitalPronoun.THEY,
            CapitalPronoun.THEM
        ]
        for subj in plural_subj:
            sentence = Sentence([subj, Verb('go').past_tense()])
            self.assertEqual(get_be_verb(sentence), BeVerb.WERE)

            sentence = Sentence([subj, Verb('go').negative().past_tense()])
            self.assertEqual(get_be_verb(sentence), BeVerb.WERE_NOT)
Beispiel #3
0
    def test_get_be_verb_present_tense_singular_subject(self):
        singular_subj = [
            Noun('cat').definite(),
            Noun('cat').indefinite(),
            Noun.uncountable_noun('water'),
            Noun.proper_noun('Joe'), Pronoun.HE, Pronoun.HIM, Pronoun.SHE,
            Pronoun.HER, Pronoun.IT, CapitalPronoun.HE, CapitalPronoun.HIM,
            CapitalPronoun.SHE, CapitalPronoun.HER, CapitalPronoun.IT
        ]
        for subj in singular_subj:
            sentence = Sentence([subj, Verb('go')])
            self.assertEqual(get_be_verb(sentence), BeVerb.IS)

            sentence = Sentence([subj, Verb('go').negative()])
            self.assertEqual(get_be_verb(sentence), BeVerb.IS_NOT)
Beispiel #4
0
 def test_get_be_verb_verb_is_be_verb(self):
     sentence = Sentence([Pronoun.HE, BeVerb.AM, Verb('is')])
     self.assertEqual(get_be_verb(sentence), BeVerb.AM)
Beispiel #5
0
 def test_get_be_verb_no_verb(self):
     sentence = Sentence([Noun('cat')])
     self.assertEqual(get_be_verb(sentence), BeVerb.BE)
Beispiel #6
0
 def test_get_be_verb_no_subject(self):
     sentence = Sentence([Verb('go')])
     self.assertEqual(get_be_verb(sentence), BeVerb.BE)