commit d38f22fbaab3dc994e89bfde3549c8c307a47ac8
parent 386dd77205834bed997c051462838069d3579e91
Author: Antoine Amarilli <a3nm@a3nm.net>
Date: Sat, 11 Jan 2020 11:59:30 +0100
fix splitting regex for python3
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/metric.py b/metric.py
@@ -84,7 +84,8 @@ def parse(text, bound):
words = text.split(' ')
words = [annotate_aspirated(word) for word in words if word != '']
- pattern = re.compile('(['+consonants+'*-]*)', re.UNICODE)
+ all_consonants = consonants + consonants.upper()
+ pattern = re.compile(r'([^' + all_consonants + '*-]+)', re.UNICODE)
# cut each word in chunks of vowels and consonants, with some specific
# kludges