Skip to content

Commit

Permalink
Merge pull request #26 from Sefaria/fix/topic-description-matching
Browse files Browse the repository at this point in the history
fix: topic description matching
  • Loading branch information
Paul-Yu-Chun-Chang authored Sep 4, 2024
2 parents 63ab6ba + 501e260 commit b3ecc21
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions VirtualHavruta/vh.py
Original file line number Diff line number Diff line change
Expand Up @@ -1169,9 +1169,10 @@ def get_topic_descriptions(topic_slugs):

# Create a dictionary with topic names as keys and their descriptions as values
final_descriptions = {}
for name, slug in zip(topic_names, topic_slugs):
if slug in descriptions:
final_descriptions[name] = descriptions[slug]
for slug, description in descriptions.items():
desc = description.strip()
if desc:
final_descriptions[slug] = desc

self.logger.info(f"MsgID={msgid}. [ONTOLOGY] Final topic descriptions: {final_descriptions}")
return final_descriptions
Expand Down

0 comments on commit b3ecc21

Please sign in to comment.