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

[CA] Fix support for "etim-s" template #1945

Merged
merged 1 commit into from
Jan 20, 2024
Merged

[CA] Fix support for "etim-s" template #1945

merged 1 commit into from
Jan 20, 2024

Conversation

BoboTiG
Copy link
Owner

@BoboTiG BoboTiG commented Jan 20, 2024

Fixes #1944

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

PR Type: Enhancement

PR Summary: The pull request introduces an enhancement to the 'etim-s' template handling in the Catalan Wiktionary parsing logic. It modifies the template processing to accommodate cases where the template contains more than two parameters, ensuring that the correct information is extracted and displayed.

Decision: Comment

📝 Type: 'Enhancement' - not supported yet.
  • Sourcery currently only approves 'Typo fix' PRs.
✅ Issue addressed: this change correctly addresses the issue or implements the desired feature.
No details provided.
✅ Small diff: the diff is small enough to approve with confidence.
No details provided.

General suggestions:

  • Ensure that the assumption that the last part is the desired output when there are more than 3 parts is valid across all use cases.
  • Consider adding a comment in the code explaining the logic behind choosing the last part as the output for cases with more than 3 parts, to clarify the intent for future maintainers.
  • Review the possibility of edge cases where the 'parts' list might be empty and ensure that the code handles such scenarios gracefully.

Thanks for using Sourcery. We offer it for free for open source projects and would be very grateful if you could help us grow. If you like it, would you consider sharing Sourcery on your favourite social media? ✨

Share Sourcery

Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@@ -104,7 +104,8 @@
# {{romanes|XIX}}
"romanes": "small_caps(parts[-1].lower())",
# {{etim-s|ca|XIV}}
"etim-s": "'segle ' + parts[2]",
# {{etim-s|ca|XVII|1617}}
"etim-s": "('segle ' + parts[2]) if len(parts) == 3 else parts[-1]",
Copy link
Contributor

Choose a reason for hiding this comment

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

question (llm): The updated logic for 'etim-s' now handles an additional case where there might be more than 3 parts. However, it assumes that the last part is the desired output when there are more than 3 parts. It would be beneficial to confirm that this assumption is always valid for the input data.

@BoboTiG BoboTiG merged commit 1da9e85 into master Jan 20, 2024
1 check passed
@BoboTiG BoboTiG deleted the fix-1944 branch January 20, 2024 15:17
@BoboTiG
Copy link
Owner Author

BoboTiG commented Jan 20, 2024

Wow, I didn't see the new Sourcery 😮

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.

[CA] Fix support for "etim-s" template
1 participant