def __init__(self, index, rule, gender, number, content, person, functions, tonic): ''' Attributes: - (see Nominal and...) - self.person: grammatical person (in grammar.PERSONS or '*'); - self.functions: S, DO, IO, R; - self.tonic: a for atonic, t for tonic. ''' Nominal.__init__(self, index, rule, gender, number, content) self.person = person self.functions = functions self.tonic = tonic
def validate(self, gender, number, ant_person, ant_number): '''Verifies compatibility between word and suggested form.''' if not Nominal.validate(self, gender, number): return False if self.ant_person not in (ant_person, '*'): return False if self.ant_number not in (ant_number, '*'): return False return True
def validate(self, person, number, gender, function, tonic): '''Verifies compatibility between word and suggested form.''' if not Nominal.validate(self, gender, number): return False if self.person not in (person, '*'): return False if function not in self.functions: return False if self.tonic != tonic: return False return True