From b0021f17938a7a922630b896ef1cfc517589205f Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Thu, 7 Nov 2024 18:40:27 -0500 Subject: [PATCH] Improved code, maybe fixed bug. --- node_normalizer/normalizer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/node_normalizer/normalizer.py b/node_normalizer/normalizer.py index 8ee34ba..7216525 100644 --- a/node_normalizer/normalizer.py +++ b/node_normalizer/normalizer.py @@ -722,16 +722,16 @@ async def create_node(app, canonical_id, equivalent_ids, types, info_contents, i any_conflation = any(conflations.values()) if not any_conflation: # No conflation. We just use the identifiers we've been given. - identifiers_with_labels = equivalent_ids[canonical_id] + identifiers_with_labels = eids else: # We have a conflation going on! To replicate Babel's behavior, we need to run the algorithem # on the list of labels corresponding to the first # So we need to run the algorithm on the first set of identifiers that have any # label whatsoever. identifiers_with_labels = [] - for identifier in equivalent_ids[canonical_id]: + for identifier in eids: curie = identifier.get('i', '') - identifiers_with_labels, types = await get_eqids_and_types(app, curie) + identifiers_with_labels, types = await get_eqids_and_types(app, [curie]) labels = map(lambda ident: ident.get('l', ''), identifiers_with_labels[curie]) if any(map(lambda l: l != '', labels)): break