Feat/danish normalization replacement bundle#29
Conversation
…d sentence replacements Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ntence replacements Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 32 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds Danish ordinal number parsing (including glued compounds and cardinal+ordinal merging) and "tusinde" plural support to the number normalizer, wires new sentence replacements into the operators config, introduces DANISH_REPLACEMENTS and DANISH_SENTENCE_REPLACEMENTS dictionaries, and adds corresponding unit tests. ChangesDanish normalization enhancements
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@normalization/languages/danish/replacements.py`:
- Around line 51-52: The demonym replacement entry is using an uppercase key,
but the normalization flow lowercases text before applying word replacements, so
the key will never match. Update the replacement mapping in the Danish
replacements table so the `Ægypter` entry uses the lowercase form `ægypter` as
the lookup key while keeping the normalized value `egypter`, alongside the other
entries in the same replacements mapping.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1586f667-78d9-4487-9212-8fe428a0333c
⛔ Files ignored due to path filters (1)
tests/e2e/files/gladia-3/da.csvis excluded by!**/*.csv
📒 Files selected for processing (6)
normalization/languages/danish/number_normalizer.pynormalization/languages/danish/operators.pynormalization/languages/danish/replacements.pynormalization/languages/danish/sentence_replacements.pytests/unit/languages/danish_number_normalizer_test.pytests/unit/languages/danish_operators_test.py
… lowercasing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Could we add some tests for ordinality, and for abbreviations replacements here?
|
Thanks for your contribution @agf-cmd! Here are two things to do to fix the CI's issues :
|
What does this PR do?
Added a bundle of extra features for Danish based on native Danish knowledge and verified by ordnet.dk. Including:
Type of change
Checklist
Only fill in the section(s) that match your change — delete the rest.
Edit existing language
replacements.py, not inline inoperators.pyNone: the step reading it still handlesNonegracefullyHow was this tested?
Summary by CodeRabbit
første,anden,1., and glued compounds likeenogtyvende.tusindeis normalized liketusind.