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

Correctly parse necnon

parent cebb3a31
No related branches found
No related tags found
No related merge requests found
......@@ -213,6 +213,10 @@ def get_unknown_syllables(token):
syll1=Syllable("cui", [token.span[0]+0,token.span[0]+3])
syll2=Syllable("qvam", [token.span[0]+3,token.span[0]+7])
return [syll1, syll2]
if strng=="necnon":
syll1=Syllable("nec", [token.span[0]+0,token.span[0]+3])
syll2=Syllable("non", [token.span[0]+3,token.span[0]+6])
return [syll1, syll2]
if strng=="seu":
syll=Syllable("seu", token.span)
return [syll]
......@@ -285,10 +289,10 @@ def get_unknown_syllables(token):
else:
res.append(Syllable("e",[res[-1].span[0]+1, res[-1].span[1]]))
for i in range(len(res)-1):
if re.match("[aeiou]", res[i].text) and re.match("[aeiou]", res[i+1].text):
res[i].syllable_length = 2
res[i+1].syllable_length = 2
for syll in res:
if re.search(r'[aeiuoy]{2}', syll.text):
syll.vowel_length = 2
syll.syllable_length = 2
return res
......
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