plint

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

commit 544c3c5d3432206dc959b9a2074d04111db9251d
parent 9a2696bfebf5df2b3afb376435ff12bc4efb127d
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Fri, 27 Apr 2012 19:25:35 +0200

fix bug in end of verse elision

Diffstat:
metric.py | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/metric.py b/metric.py @@ -29,9 +29,9 @@ def fit(chunks, pos, left): if (not is_vowels(chunks[pos])): return [[chunks[pos]] + x for x in fit(chunks, pos+1, left)] else: - if ((pos >= len(chunks) - 2 and chunks[pos] == 'e') and ( - pos <= 0 or not contains_break(chunks[pos-1])) and ( - pos <= 1 or not contains_break(chunks[pos-2]))): + if ((pos >= len(chunks) - 2 and chunks[pos] == 'e') and not ( + pos <= 0 or contains_break(chunks[pos-1])) and not ( + pos <= 1 or contains_break(chunks[pos-2]))): # special case for verse endings, which can get elided (or not) # but we don't elide lone syllables ("prends-le", etc.) if pos == len(chunks) - 1: