Ejemplo n.º 1
0
    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
Ejemplo n.º 2
0
    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
Ejemplo n.º 3
0
 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])
Ejemplo n.º 4
0
 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])