Created
October 12, 2021 17:38
-
-
Save iHaikal/8f8091ea44d9420bd432f032907dc9d6 to your computer and use it in GitHub Desktop.
Remove company suffixes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
names = ['Atlantia SpA', 'Amazon.com', 'Banco Bilbao Vizcaya Argentaria SA', 'Carl Zeiss Meditec AG', 'Antofagasta PLC', 'Bunzl plc', 'SK Hynix Inc', 'Hang Seng Bank Ltd', 'Salesforce.Com', 'Kia Motors Corp', 'Zurich Insurance Group AG'] | |
suffices = ['Inc', 'LTD', 'SA', 'AG', '.com', 'Corp', 'Group', 'SPA', 'PLC'] | |
[w[:-len(s)] for w in names for s in suffices if w.lower().endswith(s.lower())] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment