예제 #1
0
파일: verb.py 프로젝트: knighton/babi
 def check(self, allow_wildcards=True):
     assert isinstance(self.intrinsics, DeepVerb)
     self.intrinsics.check(allow_wildcards)
     assert Voice.is_valid(self.voice)
     assert isinstance(self.is_split, bool)
     assert RelativeContainment.is_valid(self.relative_cont)
     if allow_wildcards:
         assert conj is None or Conjugation.is_valid(self.conj)
         assert self.contract_not in (None, False, True)
         assert self.split_inf in (None, False, True)
         assert self.sbj_handling is None or \
             SubjunctiveHandling.is_valid(self.sbj_handling)
     else:
         assert Conjugation.is_valid(self.conj)
         assert isinstance(self.contract_not, bool)
         assert isinstance(self.split_inf, bool)
         assert SubjunctiveHandling.is_valid(self.sbj_handling)
예제 #2
0
 def check(self, allow_wildcards=True):
     assert isinstance(self.intrinsics, DeepVerb)
     self.intrinsics.check(allow_wildcards)
     assert Voice.is_valid(self.voice)
     assert isinstance(self.is_split, bool)
     assert RelativeContainment.is_valid(self.relative_cont)
     if allow_wildcards:
         assert conj is None or Conjugation.is_valid(self.conj)
         assert self.contract_not in (None, False, True)
         assert self.split_inf in (None, False, True)
         assert self.sbj_handling is None or \
             SubjunctiveHandling.is_valid(self.sbj_handling)
     else:
         assert Conjugation.is_valid(self.conj)
         assert isinstance(self.contract_not, bool)
         assert isinstance(self.split_inf, bool)
         assert SubjunctiveHandling.is_valid(self.sbj_handling)
예제 #3
0
    def check(self):
        assert isinstance(self.tokens, list)
        for s in self.tokens:
            assert isinstance(s, basestring)

        if self.conjugation is not None:
            assert Conjugation.is_valid(self.conjugation)

        assert isinstance(self.eat_prep, bool)
예제 #4
0
파일: verb_sayer.py 프로젝트: knighton/babi
    def __init__(self, lemma, whether, modal, voice, tense, aspect, mood, conj,
                 verb_form, split_inf, use_were_sbj):
        self.lemma = lemma
        assert self.lemma
        assert isinstance(self.lemma, str)

        self.whether = whether
        assert Whether.is_valid(self.whether)

        self.modal = modal
        if self.modal is not None:
            assert self.modal
            assert isinstance(self.modal, str)

        self.voice = voice
        assert Voice.is_valid(self.voice)

        self.tense = tense
        assert EphemeralTense.is_valid(tense)

        self.aspect = aspect
        assert isinstance(self.aspect, Aspect)

        self.mood = mood
        assert Mood.is_valid(self.mood)

        self.conj = conj
        assert Conjugation.is_valid(self.conj)

        self.verb_form = verb_form
        assert EphemeralVerbForm.is_valid(self.verb_form)

        self.split_inf = split_inf
        assert isinstance(self.split_inf, bool)

        self.use_were_sbj = use_were_sbj
        assert isinstance(self.use_were_sbj, bool)
예제 #5
0
    def __init__(self, lemma, whether, modal, voice, tense, aspect, mood, conj,
                 verb_form, split_inf, use_were_sbj):
        self.lemma = lemma
        assert self.lemma
        assert isinstance(self.lemma, str)

        self.whether = whether
        assert Whether.is_valid(self.whether)

        self.modal = modal
        if self.modal is not None:
            assert self.modal
            assert isinstance(self.modal, str)

        self.voice = voice
        assert Voice.is_valid(self.voice)

        self.tense = tense
        assert EphemeralTense.is_valid(tense)

        self.aspect = aspect
        assert isinstance(self.aspect, Aspect)

        self.mood = mood
        assert Mood.is_valid(self.mood)

        self.conj = conj
        assert Conjugation.is_valid(self.conj)

        self.verb_form = verb_form
        assert EphemeralVerbForm.is_valid(self.verb_form)

        self.split_inf = split_inf
        assert isinstance(self.split_inf, bool)

        self.use_were_sbj = use_were_sbj
        assert isinstance(self.use_were_sbj, bool)