psolin / cleanco

Company Name Processor written in Python
MIT License
324 stars 95 forks source link

brackets handled incorrectly #61

Open maxbachmann opened 3 years ago

maxbachmann commented 3 years ago

When clean_name() is used in the following way:

>>> cleanco('company (country) Pvt. Ltd.').clean_name()
'company (country'

it strips not only the organisation name. The expected output would be: company (country)

JonasR commented 1 year ago

This is caused by https://github.com/psolin/cleanco/blob/master/cleanco/clean.py#L22. A fix would be to add parentheses to the list of allowed characters

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

Should I open a PR for this? The project seems abandoned unfortunately.

psolin commented 1 year ago

Open a PR.

On Mon, May 15, 2023 at 4:49 AM JonasR @.***> wrote:

This is caused by https://github.com/psolin/cleanco/blob/master/cleanco/clean.py#L22. A fix would be to add parentheses to the list of allowed characters

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

Should I open a PR for this? The project seems abandoned unfortunately.

— Reply to this email directly, view it on GitHub https://github.com/psolin/cleanco/issues/61#issuecomment-1547443501, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPTE73MYXKSYUH4VZUJ4G3XGHUX7ANCNFSM4U4FVGYA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

JonasR commented 1 year ago

@psolin There you go. Sorry about the mega delay.