plint

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

commit 5d278d813449aeb5f0eef08a000a9db4c6e8f978
parent fd4ae6568bcc1e66a469f4d9503cdfecbb9f16d8
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Mon, 18 Feb 2013 21:35:24 +0100

fix bugs in contexts

Diffstat:
template.py | 3++-
vowels.py | 2+-
2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/template.py b/template.py @@ -137,7 +137,8 @@ class Template: possible = v.possible if len(possible) == 1: for i, p in enumerate(possible[0]): - if 'weight' in p.keys() and len(p['weights']) > 1: + if ('weight' in p.keys() and len(p['weights']) > 1 + and p['weights'][0] > 0): print(str(p['weight']) + ' ' + ' '.join(make_query(possible[0], i)), file=ofile) diff --git a/vowels.py b/vowels.py @@ -95,7 +95,7 @@ def possible_weights_approx(chunk): def possible_weights_seed(chunk): """Return the possible number of syllabes taken by a vowel chunk""" - if len(chunk) == 1: + if len(chunk['text']) == 1: return [1] #if chunk in ['ai', 'ou', 'eu', 'ei', 'eau', 'au', 'oi']: # return [1]