Skip to content

Instantly share code, notes, and snippets.

@iHaikal
Created October 12, 2021 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iHaikal/8f8091ea44d9420bd432f032907dc9d6 to your computer and use it in GitHub Desktop.
Save iHaikal/8f8091ea44d9420bd432f032907dc9d6 to your computer and use it in GitHub Desktop.
Remove company suffixes
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