Remove redundant title_match entries

This commit is contained in:
lexitronic
2025-08-17 04:23:03 -04:00
parent 2adb28c2c7
commit a66f280b57

View File

@@ -460,15 +460,11 @@ class DeeLogin:
candidates = [] candidates = []
for cand in candidates: for cand in candidates:
title_match_1 = max( title_match = max(
_sim(spo_title, dz_json.get('title', '')),
_sim(spo_title, dz_json.get('title_short', ''))
)
title_match_2 = max(
_sim(_remove_parentheses(spo_title), _remove_parentheses(dz_json.get('title', ''))), _sim(_remove_parentheses(spo_title), _remove_parentheses(dz_json.get('title', ''))),
_sim(_remove_parentheses(spo_title), _remove_parentheses(dz_json.get('title_short', ''))) _sim(_remove_parentheses(spo_title), _remove_parentheses(dz_json.get('title_short', '')))
) )
if max(title_match_1, title_match_2) < 0.90: if title_match < 0.90:
continue continue
c_id = cand.get('id') c_id = cand.get('id')
if not c_id: if not c_id: