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)
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)
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)