-
Notifications
You must be signed in to change notification settings - Fork 6
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
fix: choose joke type per language support #41
Conversation
feat: add portuguese puns + Pun keyword
WalkthroughThe changes in this pull request include the addition of a new entry in the "Credits" section of the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (3)
translations/en-us/vocabs.json (1)
9-13
: Maintain consistent capitalization in vocabulary termsThe capitalization is inconsistent among the terms. Consider standardizing to either all lowercase or title case.
"Pun.voc": [ - "pun", - "Wordplay", - "quip" + "Pun", + "Wordplay", + "Quip" ],README.md (1)
35-35
: Maintain consistent list style in Credits sectionThe new entry uses a dash (-) while other entries use asterisks (*). Let's maintain consistency with the existing style.
- - [Puntuguese dataset](https://github.com/Superar/Puntuguese) (portuguese puns) + * [Puntuguese dataset](https://github.com/Superar/Puntuguese) (portuguese puns)🧰 Tools
🪛 Markdownlint (0.35.0)
35-35: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
__init__.py (1)
38-46
: Consider implementing TODO items and improving category handlingThe code has two TODO items that should be addressed:
- Adding more joke types
- Implementing category blacklisting
Additionally, the category handling could be more maintainable.
Consider these improvements:
- Move category validation to a configuration:
class JokingSkill(OVOSSkill): CATEGORY_DIALOG_MAP = { "chuck_norris": "chuck_norris_jokes", "dad": "dad_jokes", "programmer": "dev_jokes", "pun": "puns" } def handle_search_joke(self, message: Message) -> None: category = message.data["search"].lower() self.log.debug("joke search: %s", category) for cat_name, dialog_name in self.CATEGORY_DIALOG_MAP.items(): if self.voc_match(voc_filename=cat_name, utt=category, lang=self.lang): self.speak_dialog(dialog_name) return self.speak_dialog("no_joke", {"search": category})
- Add category blacklisting support:
@property def blacklisted_categories(self): return self.settings.get("blacklisted_categories", ["adult", "nsfw"]) def handle_search_joke(self, message: Message) -> None: category = message.data["search"].lower() if category in self.blacklisted_categories: self.speak_dialog("inappropriate_category") return # ... rest of the methodWould you like me to create GitHub issues to track these improvements?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (5)
README.md
(1 hunks)__init__.py
(1 hunks)locale/en-us/Pun.voc
(1 hunks)locale/pt-pt/Pun.voc
(1 hunks)translations/en-us/vocabs.json
(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- locale/en-us/Pun.voc
- locale/pt-pt/Pun.voc
🧰 Additional context used
🪛 Markdownlint (0.35.0)
README.md
35-35: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
feat: add portuguese puns + Pun keyword
Summary by CodeRabbit
New Features
Bug Fixes
Documentation