diff --git a/allzweckmesser/scanner.py b/allzweckmesser/scanner.py index b500264996574f93b9c51d99eba0aab68bcc5705..0b2d3eefede6daf678a25b1d21902d40cafb647e 100644 --- a/allzweckmesser/scanner.py +++ b/allzweckmesser/scanner.py @@ -209,7 +209,7 @@ def get_syllables_for_accented_form(token): syll_vowel_length = 1 syll_has_vowel = False for i, c in enumerate(chunks): - if c[0] in 'aeiouy': + if c[0] in 'AEIOUYaeiouy': if syll_has_vowel: # Syllable already has a vowel. # Add the current syllable and begin a new one. @@ -229,7 +229,7 @@ def get_syllables_for_accented_form(token): syll_text += c.rstrip('_^') syll_has_vowel = True syll_vowel_length = ( - 2 if len(c) > 1 and c[1] in 'aeiouy_' else 1 + 2 if len(c) > 1 and c[1] in 'AEIOUYaeiouy_' else 1 ) else: syll_text += c.rstrip('_^') @@ -388,7 +388,7 @@ def get_syllables(reading): def muta_cum_liquida(verse): mcl_regex = re.compile( - r'[aeiouv](([bpsckgdt]|(qu)|(qv))\W*[lrmn])([aeiouv]|[.?!]|$)', + r'[aeiouvy](([bpsckgdt]|(qu)|(qv))\W*[lrmn])([aeiouvy]|[.?!]|$)', flags=re.IGNORECASE ) if re.search(mcl_regex, verse.text): @@ -406,7 +406,7 @@ def muta_cum_liquida(verse): def positional_lengthening(verse): pl_regex = re.compile( - r'[aeiouv](((([bcdfgjklmnprstvwxz]h?|(qu))\W*){2,})|[xz])', + r'[aeiouvy](((([bcdfgjklmnprstvwxz]h?|(qu))\W*){2,})|[xz])', flags=re.IGNORECASE ) for match in re.finditer(pl_regex, verse.text): @@ -439,9 +439,11 @@ def make_elisions(verse): # Break the for and continue with the next reading. break - m = re.search(r'[aeiouy][mh]*$', this_syllable.text) + m = re.search(r'[aeiouy][mh]*$', this_syllable.text, + flags=re.IGNORECASE) if m: - if re.search(r'^h?[aeiouy]', next_syllable.text): + if re.search(r'^h?[aeiouy]', next_syllable.text, + flags=re.IGNORECASE): # Elision! elision = Phenomenon(omitted=m.group()) this_syllable.phenomena['elision'] = elision