Avoid glueing words together. Fixes #15

This commit is contained in:
Julien Palard 2020-06-28 11:13:45 +02:00
parent e216d5638b
commit 7f9a3fd980
1 changed files with 8 additions and 2 deletions

View File

@ -151,8 +151,14 @@ def clear(po_path, line, drop_capitalized=False):
if logging.getLogger().isEnabledFor(logging.DEBUG):
for pattern in to_drop:
for dropped in regex.findall(pattern, line):
logging.debug("%s: dropping %r due to from %r", po_path, dropped, line)
return regex.sub("|".join(to_drop), r"", line)
logging.debug(
"%s: dropping %r via %r due to from %r",
po_path,
dropped,
pattern,
line,
)
return regex.sub("|".join(to_drop), r" ", line)
def po_to_text(po_path, drop_capitalized=False):