Example #1
0
 def test_dont_capitalize_just_anything_starting_with_mac(self):
     self.assertEqual('Machinists/Aerospace Workers Union', str(OrganizationNameCleaver('MACHINISTS/AEROSPACE WORKERS UNION').parse()))
Example #2
0
 def test_expand(self):
     self.assertEqual('Raytheon Corporation', OrganizationNameCleaver('Raytheon Corp.').parse().expand())
     self.assertEqual('Massachusetts Institute of Technology', OrganizationNameCleaver('Massachusetts Inst. of Technology').parse().expand())
Example #3
0
 def test_doesnt_bother_names_containing_string_pac(self):
     self.assertEqual('Pacific Trust', str(OrganizationNameCleaver('PACIFIC TRUST').parse()))
Example #4
0
 def test_capitalize_scottish_names(self):
     self.assertEqual('McDonnell Douglas', str(OrganizationNameCleaver('MCDONNELL DOUGLAS').parse()))
     self.assertEqual('MacDonnell Douglas', str(OrganizationNameCleaver('MACDONNELL DOUGLAS').parse()))
Example #5
0
 def test_make_single_word_names_ending_in_pac_all_uppercase(self):
     self.assertEqual('ECEPAC', str(OrganizationNameCleaver('ECEPAC').parse()))
Example #6
0
 def test_names_starting_with_PAC(self):
     self.assertEqual('PAC For Engineers', str(OrganizationNameCleaver('PAC FOR ENGINEERS').parse()))
     self.assertEqual('PAC 102', str(OrganizationNameCleaver('PAC 102').parse()))
Example #7
0
 def test_handles_empty_names(self):
     self.assertEqual('', str(OrganizationNameCleaver('').parse()))
Example #8
0
 def test_capitalize_pac(self):
     self.assertEqual('Nancy Pelosi Leadership PAC', str(OrganizationNameCleaver('NANCY PELOSI LEADERSHIP PAC').parse()))
Example #9
0
 def test_expand_with_two_tokens_to_expand(self):
     self.assertEqual('Merck & Company Incorporated', OrganizationNameCleaver('Merck & Co., Inc.').parse().expand())
Example #10
0
 def test_drop_postname_hyphen_phrases(self):
     self.assertEqual('Lawyers For Better Government', OrganizationNameCleaver('LAWYERS FOR BETTER GOVERNMENT-ILLINOIS').parse().without_extra_phrases())
     self.assertEqual('Jobs Opportunity And Freedom Political Action Committee', OrganizationNameCleaver('JOBS OPPORTUNITY AND FREEDOM POLITICAL ACTION COMMITTEE - JOFPAC').parse().without_extra_phrases())
Example #11
0
 def test_parse_safe__organization(self):
     self.assertEqual('', OrganizationNameCleaver(None).parse(safe=True))
Example #12
0
 def test_organization(self):
     self.assertEqual(u'\u00C6tna, Inc.'.encode('utf-8'),
             str(OrganizationNameCleaver(u'\u00C6tna, Inc.').parse()))
Example #13
0
 def test_capitalizes_letter_after_hyphen(self):
     self.assertEqual('Non-Profit Institutions', str(OrganizationNameCleaver('NON-PROFIT INSTITUTIONS').parse()))
     self.assertEqual('Pro-Israel', str(OrganizationNameCleaver('PRO-ISRAEL').parse()))
Example #14
0
 def test_capitalizes_letter_after_slash(self):
     self.assertEqual('Health Services/Hmos', str(OrganizationNameCleaver('HEALTH SERVICES/HMOS').parse()))
     self.assertEqual('Lawyers/Law Firms', str(OrganizationNameCleaver('LAWYERS/LAW FIRMS').parse()))
Example #15
0
 def test_overrides_dumb_python_titlecasing_for_apostrophes(self):
     self.assertEqual('Phoenix Women\'s Health Center', str(OrganizationNameCleaver('PHOENIX WOMEN\'S HEALTH CENTER').parse()))