songleash

generate chansons en laisse
git clone https://a3nm.net/git/songleash/
Log | Files | Refs

commit 07ad464dbe7965ca28c4c11da83a9afe901e5ce0
parent 2cba8349995a50026e42cdcfa75d58f4aed10405
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Wed, 26 Aug 2015 22:12:46 +0200

rename

Diffstat:
common.py | 2+-
cycle.py | 6+++---
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/common.py b/common.py @@ -21,7 +21,7 @@ def fem(w): # http://stackoverflow.com/questions/517923/what-is-the-best-way-to-remove-accents-in-a-python-unicode-string -def rmacc(s): +def strip_accents(s): """Strip accent from a string with_except keeps specifically 'é' and 'è'""" diff --git a/cycle.py b/cycle.py @@ -1,7 +1,7 @@ -#!/usr/bin/python3 +m!/usr/bin/python3 import sys -from common import fem, vowels_script, rmacc, semivowels +from common import fem, vowels_script, strip_accents, semivowels # TODO use defaultdict @@ -17,7 +17,7 @@ def print_word(w, prn): for i in range(len(w)): p = -(i+1) s += w[p] - x = rmacc(w[p])[0] + x = strip_accents(w[p])[0] if not vowels: if x in vowels_script and (i > 0 or w[-1] != 'e') and (i > 1 or w[-1] != 's' or w[-2] != 'e') and (i > 2 or (not w.endswith('gue'))