Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a test to warn on short names #165

Draft
wants to merge 2 commits into
base: babel-1.0
Choose a base branch
from
Draft

Conversation

gaurav
Copy link
Collaborator

@gaurav gaurav commented Jul 7, 2023

This PR adds a warning for short names in the list of synonyms for a CURIE, as this could be a sign of incorrect synonyms being included in Babel. Also: we sometimes get duplicate synonyms, which I've just realized is because synonym_factory.get_synonyms() only ensures that (relation, synonym) tuples are unique. I've added a set() to ensure that the actual synonyms are unique, too.

@gaurav gaurav changed the title Added a test to warn on short names. Added a test to warn on short names Jul 7, 2023
@gaurav gaurav mentioned this pull request Jul 7, 2023
@gaurav gaurav requested a review from cbizon July 17, 2023 21:51
@@ -1,4 +1,6 @@
{
"warn_on_short_names": 3,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how often does this happen? I would assume we're going to see zillions of warnings...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

769,715 times in 2023jul9, and 1,857,487 times in the current Babel... so yeah, probably too often to be useful :(. I'll close this PR and make a new one just to fix the loophole in synonym uniquification.

gaurav added a commit that referenced this pull request Jul 25, 2023
We sometimes get duplicate synonyms in the output, which I've realized is because `synonym_factory.get_synonyms()` only ensures that `(relation, synonym)` tuples are unique. I've added a `set()` to ensure that the actual synonyms are unique, too. (Split off from PR #165).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants