imporved hyphenation to build.py

This commit is contained in:
Bachir Soussi Chiadmi
2017-06-19 19:24:24 +02:00
parent 6dca30e067
commit 567f6e3a30
+5 -3
View File
@@ -243,10 +243,12 @@ def hyphenate(node):
pass
# add none breaking spaces
nbspzr = ['"', '»', '«', '\.', '\!', '\?', ':', ';']
for char in nbspzr:
# print(char)
nbspzr_before = ['"', '»', '\!', '\?', ':', ';']
for char in nbspzr_before:
nodestr = re.sub(r'('+char+')\s(\w)', r'\1 \2', nodestr)
nbspzr_after = ['"', '«']
for char in nbspzr_after:
nodestr = re.sub(r'(\w)\s('+char+')', r'\1 \2', nodestr)
# print(nodestr)