Skip to content
Snippets Groups Projects
Commit a202eaeb authored by Victor Zimmermann's avatar Victor Zimmermann
Browse files

Add restrictions to RegEx, resolves #18

parent f44cdfae
No related branches found
No related tags found
No related merge requests found
......@@ -233,7 +233,7 @@ def get_syllables(reading):
def muta_cum_liquida(verse):
mcl_regex = re.compile(r'([bpsckgdt]|(qu)|(qv)),?\s?[lrmn]')
mcl_regex = re.compile(r'[aeiouv](([bpsckgdt]|(qu)|(qv)),?\s?[lrmn])([aeiouv]|[.?!]|$)')
if re.search(mcl_regex, verse.text):
matches = re.finditer(mcl_regex, verse.text)
......@@ -243,10 +243,9 @@ def muta_cum_liquida(verse):
for syllable in token.syllables:
if syllable.span[0]<= match.start() < syllable.span[1]:
syllable.phenomena['muta cum liquida'] = Phenomenon(chars=match.group(1))
syllable.phenomena['muta cum liquida'] = Phenomenon(chars=match.group(0))
def positional_lengthening(verse):
pl_regex = re.compile(r'[aeiouv](((([bcdfgjklmnprstvwxz]|(qu)),?\s?){2,})|[xz])')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment