commit b60cef707d8ffb22c4e11c4c0d938f68b420c89e parent b4bee8aa3ef163d1b0528455d30b11ea37671ef8 Author: Antoine Amarilli <a3nm@a3nm.net> Date: Wed, 20 Feb 2013 19:05:29 +0100 Exception for "alcoyle" Thanks, Gilles Esposito-Farese Diffstat:
verse.py | | | 10 | +++++++--- |
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/verse.py b/verse.py @@ -130,9 +130,13 @@ class Verse: chunk['text'].startswith("y")): new_word.append(chunk) continue - # special case of "pays" - if (chunk['text'] == "ay" and j > 0 and j < len(w) - 1 and - w[j-1]['text'].endswith("p") and w[j+1]['text'].startswith("s")): + # special cases of "pays" and "alcoyle" + if (j > 0 and j < len(w) - 1 and + ((chunk['text'] == "ay" and w[j-1]['text'].endswith("p") + and w[j+1]['text'].startswith("s")) + or + (chunk['text'] == "oy" and w[j-1]['text'].endswith("lc") + and w[j+1]['text'].startswith("l")))): new_word.append(chunk) # force weight chunk['weights'] = [2]