imporved hyphenation to build.py

This commit is contained in:
Bachir Soussi Chiadmi
2017-06-19 19:33:56 +02:00
parent 40d8450ccf
commit 8d169ca5ab
+2 -2
View File
@@ -245,11 +245,11 @@ def hyphenate(node):
# add none breaking spaces
nbspzr_before = ['»', '\!', '\?', ':', ';']
for char in nbspzr_before:
nodestr = re.sub(r'('+char+')\s(\w)', r'\1 \2', nodestr)
nodestr = re.sub(r'(\w)\s('+char+')', r'\1 \2', nodestr)
nbspzr_after = ['«']
for char in nbspzr_after:
nodestr = re.sub(r'(\w)\s('+char+')', r'\1 \2', nodestr)
nodestr = re.sub(r'('+char+')\s(\w)', r'\1 \2', nodestr)
# print(nodestr)
# replace node by hyphenated one