Browse Source

Added line tags

main
lhess2021 4 years ago
parent
commit
924bc42396
  1. 6
      py-scripts.d/word-tags.py

6
py-scripts.d/word-tags.py

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

Loading…
Cancel
Save