From 75d2a7ec0adc958dc671515600e1306eb76070bd Mon Sep 17 00:00:00 2001 From: Michiel Nijhuis Date: Tue, 7 May 2024 17:17:47 +0200 Subject: [PATCH] updated version and tests --- name_matching/test/test_name_matcher.py | 9 ++++++++- setup.py | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/name_matching/test/test_name_matcher.py b/name_matching/test/test_name_matcher.py index 59e213d..a5ab6b3 100644 --- a/name_matching/test/test_name_matcher.py +++ b/name_matching/test/test_name_matcher.py @@ -402,6 +402,8 @@ def test_search_for_possible_matches(name_match, adjusted_name, top_n, low_memor ['Company and Sons'], index=['company_name']), 71.28, 68.6), (False, 2, np.array([29, 343]), pd.Series( ['Company and Sons'], index=['company_name']), 71.28, 68.6), + (['Sons', 'and'], 3, np.array([29, 343, 126, 238, 445]), pd.Series( + ['Company and Sons'], index=['company_name']), 31.33, 31.77), (False, 2, np.array([[29, 343], [0, 0]]), pd.Series( ['Company and Sons'], index=['company_name']), 71.28, 68.6), (False, 2, np.array([29, 343, 126, 238, 445]), pd.Series( @@ -411,7 +413,12 @@ def test_fuzzy_matches(name_match, common_words, num_matches, possible_matches, name_match._column_matching = 'company_name' name_match._number_of_matches = num_matches name_match._postprocess_common_words = common_words - name_match._word_set = set(['Sons', 'and']) + if isinstance(common_words, list): + name_match._word_set = set(common_words) + elif common_words: + name_match._word_set = set(['Sons', 'and']) + else: + name_match._word_set = set() match = name_match.fuzzy_matches(possible_matches, matching_series) assert match['score_0'] == pytest.approx(result_0, 0.0001) assert match['score_1'] == pytest.approx(result_1, 0.0001) diff --git a/setup.py b/setup.py index 7d8533f..bd0937b 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name='name_matching', - version='0.8.9', + version='0.8.10', description='A package for the matching of company names', author='Michiel Nijhuis', author_email='m.nijhuis@dnb.nl',