commit 1c38fa381f934d5ed2590f23cb097041c0166e6d
parent 649457c09622ebbfb64f2bb04206438f8269498f
Author: Antoine Amarilli <a3nm@a3nm.net>
Date: Mon, 30 Apr 2012 12:55:56 +0200
specific handling of rimes normandes
Diffstat:
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/TODO b/TODO
@@ -1,3 +1,5 @@
+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/rhyme.py b/rhyme.py
@@ -111,6 +111,13 @@ def concat_couples(a, b):
return s
def lookup(s):
+ """lookup the pronunciation of s, adding rime normande kludges"""
+ result = raw_lookup(s)
+ if s.endswith('er'):
+ result.add("ER")
+ return result
+
+def raw_lookup(s):
# kludge: take the last three words and concatenate them to take short words
# into account
s = s.split(' ')[-3:]