newt = ''
wlist = re.compile(r'\w+|[^\w]', re.UNICODE).findall(t)
for w in wlist:
newt += hyph.inserted(w, u'\u00AD')
newt = ''
wlist = re.compile(r'\w+|[^\w]', re.UNICODE).findall(t)
for w in wlist:
newt += hyph.inserted(w, u'\u00AD')
- if hyphenate:
- hyphenator = set_hyph_language(wldoc.edoc.getroot())
- hyphenate_and_fix_conjunctions(wldoc.edoc.getroot(), hyphenator)
+ hyphenator = set_hyph_language(wldoc.edoc.getroot()) if hyphenate else None
+ hyphenate_and_fix_conjunctions(wldoc.edoc.getroot(), hyphenator)
# every input file will have a TOC entry,
# pointing to starting chunk
# every input file will have a TOC entry,
# pointing to starting chunk