plint

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

commit cec8c7d14913149697529f69465bbc899116c5ad
parent c8db5544abcbab50a4ae92fccb7028cfe2c8b097
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Sat, 10 Aug 2019 23:29:05 +0200

hiatus with "et" is forbidden

Diffstat:
verse.py | 15+++++++++++----
views/about.html | 8++++++--
2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/verse.py b/verse.py @@ -341,11 +341,18 @@ class Verse: if 'elision' not in nchunk.keys() or True not in nchunk['elision']: w[-1]['error'] = "ambiguous" self.chunks[i+1][0]['error'] = "ambiguous" - elif ((is_vowels(w[-1]['text']) or w[-1]['text'] == 'Y') and not - w[-1]['text'].endswith('e')): + # elision concerns words ending with a vowel without a mute 'e' + # that have not been marked "no_hiatus" + # it also concerns specifically "et" + elif (not w[-1]['text'].endswith('e') and 'no_hiatus' not in w[-1].keys() + and (is_vowels(w[-1]['text']) + or w[-1]['text'] == 'Y') + or (len(w) == 2 + and w[0]['text'] == 'e' and w[1]['text'] == 't')): + # it happens if the next word is not marked no_hiatus + # and starts with something that causes elision if (False not in self.chunks[i+1][0]['elision'] and - 'no_hiatus' not in self.chunks[i+1][0].keys() and - 'no_hiatus' not in w[-1].keys()): + 'no_hiatus' not in self.chunks[i+1][0].keys()): w[-1]['error'] = "hiatus" self.chunks[i+1][0]['error'] = "hiatus" diff --git a/views/about.html b/views/about.html @@ -79,7 +79,9 @@ erreurs&nbsp;: cela est documenté <a href="#template">plus bas</a>.</p> <dd>Le hiatus (juxtaposition de sons vocaliques sans 'e' muet intercalaire) est interdit en poésie classique et signalé. Plus précisément, il y a hiatus lorsqu'un mot se termine par une voyelle (sauf 'e' muet) et que le mot suivant - commence par une voyelle ou par un <em>h</em> non-aspiré</dd> + commence par une voyelle ou par un <em>h</em> non-aspiré. Les consonnes + muettes en fin de mot évitent l'hiatus, sauf dans le cas particulier du mot + "et" (dont on considère qu'il se termine par un son vocalique).</dd> <dt id="whatcheck_repeated">Mots répétés</dt> <dd>On ne doit pas faire rimer un mot avec lui-même (mais on peut faire rimer un mot avec des homographes de nature grammaticale différente), ainsi, plint @@ -330,7 +332,9 @@ source code.</p> <dd>Juxtaposition of vowel sounds in two adjacent words with no mute 'e' in the middle is forbidden and reported. Specifically, it is forbidden to end a word with a vowel (except mute 'e') and have the next word start with a vowel - or a non-aspirated <em>h</em>.</dd> + or a non-aspirated <em>h</em>. Mute consonants at the end of the word avoid + hiatus, except in the specific case of the word "et" (which is considered to + end by a vowel sound).</dd> <dt id="whatcheck_repeated">Repeated words</dt> <dd>A word may not rhyme with itself, but may rhyme with a homograph of a different grammatical nature, so plint will report as error any multiple