Skip to content
Snippets Groups Projects
Commit cde39939 authored by Simon Will's avatar Simon Will
Browse files

Merge branch 'master' of gitlab.cl.uni-heidelberg.de:Messerschleifer/Allzweckmesser

parents 3656cdf7 95a3d358
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'([bpskgdt]|(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])')
......@@ -259,6 +258,7 @@ def positional_lengthening(verse):
for syllable in token.syllables:
if syllable.span[0]<= match.start() < syllable.span[1]:
s.syllable_length = 2
syllable.phenomena['positional lengthening'] = Phenomenon(chars=match.group(1))
......@@ -306,10 +306,12 @@ def parse_verse(verse):
for token in new_reading.tokens:
for s in token.syllables:
if blueprint[syll_id] == "1":
print(1)
s.syllable_length = 1
if 'positional lengthening' in s.phenomena and 'muta cum liquida' in s.phenomena:
s.phenomena['positional lengthening'].overruled_by = 'muta cum liquida'
elif blueprint[syll_id] == "2":
print(2)
s.syllable_length = 2
syll_id += 1
......
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