plint

French poetry validator
git clone https://a3nm.net/git/plint/
Log | Files | Refs | README

commit 48c62571db0d1fc8b1d5794523d6b583dd793ba4
parent ea20448a504579a20fde976ddbfeef81cbb2d300
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Sun, 10 Jun 2012 20:05:01 +0200

slightly better reporting of rhyme errors

Diffstat:
error.py | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/error.py b/error.py @@ -60,7 +60,8 @@ class ErrorBadRhyme(Error): # TODO indicate eye rhyme since this is also important # TODO don't indicate more than the minimal required rhyme (in length and # present of a vowel phoneme) - return Error.report(self, "Bad rhyme %s for type %s (expected %s, inferred %s)" + return Error.report(self, + "Bad rhyme %s for type %s (expected %s, inferred %s)" % (self.kind, self.get_id(), self.fmt(self.expected), self.fmt(self.inferred)), short) @@ -80,12 +81,12 @@ class ErrorBadRhymeGenre(ErrorBadRhyme): class ErrorBadRhymeSound(ErrorBadRhyme): def fmt(self, l): - #TODO handle other types pron = l.phon ok = [] if len(pron) > 0: ok.append("") - return '/'.join(list(set([common.to_xsampa(x[-4:]) for x in pron]))) + return ('/'.join(list(set([common.to_xsampa(x[-4:]) for x in pron]))) + + " (ending: " + l.eye + ")") def get_id(self): return self.pattern.myid