|
|
@ -69,8 +69,10 @@ def add_tags(canto_txt_file): |
|
|
line_spaced = re.sub(' ',' ',line) |
|
|
line_spaced = re.sub(' ',' ',line) |
|
|
# If there's a single space at the beginning of the line, delete it |
|
|
# If there's a single space at the beginning of the line, delete it |
|
|
line_spaced = line_spaced.lstrip(' ') |
|
|
line_spaced = line_spaced.lstrip(' ') |
|
|
# Add three tabs at the beginning |
|
|
# Add three tabs and opening line tags at the beginning |
|
|
line_spaced = re.sub('^','\t\t\t\t\t',line_spaced) |
|
|
line_spaced = re.sub('^','\t\t\t\t\t<l> ',line_spaced) |
|
|
|
|
|
# Add closing line tags |
|
|
|
|
|
line_spaced = re.sub('\n',' </l>\n',line_spaced) |
|
|
Cxml.write(line_spaced) |
|
|
Cxml.write(line_spaced) |
|
|
Cxmltmp.close() |
|
|
Cxmltmp.close() |
|
|
os.remove(tmpxmlfile) |
|
|
os.remove(tmpxmlfile) |
|
|
|