plint

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

commit e36b56e8f044e93ff97f66966588dd5de13de3d1
parent 44b1e23e0f3d2b4821b635ad0f2531177de96114
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Fri, 20 Dec 2013 23:27:11 +0100

Merge branch 'master' of mu.a3nm.net:git/plint

Diffstat:
options.py | 13+++++++++++++
template.py | 16+++-------------
2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/options.py b/options.py @@ -0,0 +1,13 @@ +default_options = { + 'forbidden_ok': False, + 'hiatus_ok': False, + 'normande_ok': True, + 'eye_supposed_ok': True, + 'phon_supposed_ok': True, + 'eye_tolerance_ok': True, + 'repeat_ok': True, + 'incomplete_ok': True, + 'check_end_hemistiche': True, + 'check_occurrences': True, + 'diaeresis': "classical" + } diff --git a/template.py b/template.py @@ -7,6 +7,7 @@ from common import normalize, legal, strip_accents_one, rm_punct from nature import nature_count from vowels import possible_weights_ctx, make_query from pprint import pprint +from options import default_options class Pattern: @@ -51,22 +52,11 @@ class Template: 'oeil_tolerance_ok': 'eye_tolerance_ok' } + def __init__(self, string=None): self.template = [] self.pattern_line_no = 0 - self.options = { - 'forbidden_ok': False, - 'hiatus_ok': False, - 'normande_ok': True, - 'eye_supposed_ok': True, - 'phon_supposed_ok': True, - 'eye_tolerance_ok': True, - 'repeat_ok': True, - 'incomplete_ok': True, - 'check_end_hemistiche': True, - 'check_occurrences': True, - 'diaeresis': "classical" - } + self.options = dict(default_options) self.mergers = [] self.overflowed = False if string != None: