Merge pull request #5 from xi/drop-shy

drop soft hyphens
This commit is contained in:
Julien Palard 2019-10-17 09:46:14 +02:00 committed by GitHub
commit df6f43a3cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -140,6 +140,7 @@ def clear(po_path, line, drop_capitalized=False):
r"[0-9]+h", # Hours
r"%\([a-z_]+?\)s", # Sphinx variable
r"« . »", # Single letter examples (typically in Unicode documentation)
"\xad", # soft hyphen
}
if drop_capitalized:
to_drop.add(

View File

@ -30,6 +30,9 @@ def test_clear():
# We remove single letters in quotes
assert clear("test", "La lettre « é » est seule.") == "La lettre est seule."
# We remove soft hyphens
assert clear("some\xadthing") == "something"
# We drop hours because hunspell whines on them
assert clear("test", "Rendez-vous à 10h chez Murex") == "Rendez-vous à chez Murex"