Open lizadaly opened 3 years ago
Source material: http://inamidst.com/stuff/sappho/
Code:
from pathlib import Path
import re
poem = Path("poems.txt")
for num, line in enumerate(poem.open()):
if "Lobel-Page" in line or "LP" in line:
if section := re.match(r"^\D*([\d]+).*$", line):
print(f"\n\n({section.group(1)})\n\n")
if elisions := re.findall(r"([. \]\[])", line):
out = ""
for ell in elisions:
out += ell
if out.strip():
print(out)
It may be incomplete, but have a completed label :)
A poem comprised of only the elision markers from Sappho's poetry: