-
-
Notifications
You must be signed in to change notification settings - Fork 0
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: normalization + disable new feats by default #38
Conversation
Warning Rate limit exceeded@github-actions[bot] has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 27 minutes and 52 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThe pull request introduces changes to the Changes
Possibly related PRs
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
🧹 Nitpick comments (1)
ovos_padatious/opm.py (1)
283-287
: LGTM! Consider optimizing the stemmer initialization.The conditional initialization of stemmers based on configuration is well-implemented. However, the code could be more concise.
- if self.config.get("stem", False): - self.stemmers = {lang: Stemmer(lang) - for lang in langs if Stemmer.supports_lang(lang)} - else: - self.stemmers = {} + self.stemmers = {lang: Stemmer(lang) + for lang in langs + if self.config.get("stem", False) and Stemmer.supports_lang(lang)}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
ovos_padatious/opm.py
(3 hunks)
🧰 Additional context used
🪛 Ruff (0.8.2)
ovos_padatious/opm.py
477-480: Use ternary operator stemmer = self.stemmers[lang] if lang in self.stemmers else None
instead of if
-else
-block
Replace if
-else
-block with stemmer = self.stemmers[lang] if lang in self.stemmers else None
(SIM108)
477-480: Use stemmer = self.stemmers.get(lang, None)
instead of an if
block
Replace with stemmer = self.stemmers.get(lang, None)
(SIM401)
🔇 Additional comments (2)
ovos_padatious/opm.py (2)
474-476
: LGTM! Template expansion now occurs before normalization.This change correctly fixes the order of operations by expanding templates before normalization, which was the core issue mentioned in the PR objectives.
337-337
: LGTM! ASCII normalization is now configurable.The implementation consistently uses the "cast_to_ascii" configuration option across both matching and registration methods, defaulting to False. This aligns with making new features opt-in.
Also applies to: 484-484
* fix: normalization + disable new feats by default (#38) * fix: normalization + disable new feats by default * fix: normalization + disable new feats by default * Increment Version to 1.3.1a1 * Update Changelog --------- Co-authored-by: JarbasAI <[email protected]> Co-authored-by: JarbasAl <[email protected]>
bug introduced in #35 , template expansion needs to be done before stemming
disable by default for backwards compat, require enabling in config
Summary by CodeRabbit
New Features
Improvements