def __str__(self): if self.cases: # Return one line per combination of cases def pad(s, field=16): l = len(s) return s if l > field else s + (field - l) * ' ' return "\n".join(pad(self.nom) + (" " if c else "") + \ c + ("".join(" /" + prep for prep in self.cases[c])) \ for c in sort_strings(self.cases.keys())) return self.nom
def __str__(self): if self.cases: # Return one line per combination of cases def pad(s, field = 16): l = len(s) return s if l > field else s + (field - l) * ' ' return "\n".join(pad(self.nom) + (" " if c else "") + \ c + ("".join(" /" + prep for prep in self.cases[c])) \ for c in sort_strings(self.cases.keys())) return self.nom
def enum_cases_and_preps(self): """ Generator for argument cases and prepositions, yielded as tuples of (cases, preps) """ for c in sort_strings(self.cases.keys()): yield (c, self.cases[c])