Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
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'
Ejemplo n.º 3
0
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