plint

French poetry validator (local mirror of https://gitlab.com/a3nm/plint)
git clone https://a3nm.net/git/plint/
Log | Files | Refs | README

commit c5ac88484bb02de828d2e2b7c126e5705cb72d08
parent 1c38fa381f934d5ed2590f23cb097041c0166e6d
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Mon, 30 Apr 2012 17:40:11 +0200

handle sigles

Diffstat:
TODO | 2--
metric.py | 17++++++++++++-----
2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/TODO b/TODO @@ -1,5 +1,3 @@ -all the classical rules :-/ - check that there are no more repetitions of the same word for a rhyme than there are different functions for it diff --git a/metric.py b/metric.py @@ -112,11 +112,18 @@ def parse(text, bound): if (words[i] == "onze"): words[i] = "*" + words[i] - if len(words[i]) == 1 and words[i][0] in consonants: - if (words[i] == 'w'): - words[i] = "doublevé" - else: - words[i] = words[i] + "a" + all_consonants = True + for x in words[i]: + if not x in consonants: + all_consonants = False + if all_consonants: + new_word = '' + for x in words[i]: + if (words[i] == 'w'): + new_word += "doublevé-" + else: + new_word += words[i]+'a-' + words[i] = new_word # aspirated