Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow closing parenthesis as valid trailing symbol #88

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cleanco/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from .termdata import terms_by_type, terms_by_country
from .non_nfkd_map import NON_NFKD_MAP

tail_removal_rexp = re.compile(r"[^\.\w]+$", flags=re.UNICODE)
tail_removal_rexp = re.compile(r"[^\.\w)]+$", flags=re.UNICODE)


def get_unique_terms():
Expand Down
3 changes: 2 additions & 1 deletion tests/test_cleanname.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ def test_double_cleanups():

preserving_cleanup_tests = {
"name with comma": ("Hello, World, ltd.", "Hello, World"),
"name with dot": ("Hello. World, Oy", "Hello. World")
"name with dot": ("Hello. World, Oy", "Hello. World"),
"name ending with closing parenthesis": ("Hello World (Country) Ltd.", "Hello World (Country)"),
}

def test_preserving_cleanups():
Expand Down