コード例 #1
0
def _needs_third_person(sentence: Sentence):
    verb_index = sentence.get_verb()
    subject_index = sentence.get_subject()
    if verb_index == -1 or subject_index == -1:
        return False

    subject = sentence.get(subject_index)

    first_person = (Pronoun.I, Pronoun.ME, CapitalPronoun.I, CapitalPronoun.ME)
    if isinstance(subject, (Noun, AbstractPronoun)) and subject not in first_person:
        return not subject.has_tags(WordTag.PLURAL)
    return False
コード例 #2
0
 def test_get(self):
     sentence = Sentence([BeVerb.AM, BasicWord('I'), Punctuation.QUESTION])
     self.assertEqual(sentence.get(0), BeVerb.AM)