def test_hihat_with_known_abbrevs(abbrevs, long_name, expected_abbrev): known_abbrevs = dict( exxon="xon", cisco="csco", jpmorgan="jpm", ) if abbrevs: assert idm.hihat(long_name, 4, known_abbreviations=known_abbrevs ) == expected_abbrev else: assert idm.hihat(long_name, 4) == expected_abbrev
def test_hihat_with_stop_words(): stop_words = [ "company", "corporation", # "inc", "incorporated", "international", "limited", # "ltd", ] assert idm.hihat("Lloyds Bank Ltd", 4, stop_words=None) == 'lloy' assert idm.hihat("Lloyds Bank Ltd", 4, stop_words=stop_words) == 'lblx'
def test_hihat_with_default_stop_words_and_abbrs(long_name, short_name_length, expected_abbrev): assert idm.hihat(long_name, short_name_length) == expected_abbrev