forked from AFPy/pospell
allow underscors in variables
This commit is contained in:
parent
b3ec58b63d
commit
aa5bfee35d
|
@ -135,7 +135,7 @@ def clear(po_path, line, drop_capitalized=False):
|
|||
r" - ", # Drop lone dashes (sometimes used in place of -- or ---)
|
||||
r"-\\ ", # Ignore "MINUS BACKSLASH SPACE" typically used in
|
||||
# formulas, like '-\ *π*' but *π* gets removed too
|
||||
r"{[a-z]*?}", # Sphinx variable
|
||||
r"{[a-z_]*?}", # Sphinx variable
|
||||
r"'?-?\b([0-9]+\.)*[0-9]+\.[0-9abcrx]+\b'?", # Versions
|
||||
r"[0-9]+h", # Hours
|
||||
r"%\([a-z_]+?\)s", # Sphinx variable
|
||||
|
|
|
@ -45,6 +45,9 @@ def test_clear():
|
|||
== "Hier, Marc-André Lemburg a fait"
|
||||
)
|
||||
|
||||
# We remove variables
|
||||
assert clear("test", "Starting {days_since} days ago") == "Starting days ago"
|
||||
|
||||
# Drop PEP 440 versions
|
||||
assert (
|
||||
clear("test", "under python 1.6a1, 1.5.2, and earlier.")
|
||||
|
|
Loading…
Reference in New Issue
Block a user