-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[pt] Added rule ID:DEMASIADO_INVARIAVEL #10905
Conversation
Warning Rate limit exceeded@marcoagpinto has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 5 minutes and 11 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. WalkthroughA new grammar rule has been introduced for Portuguese in the Changes
Possibly related PRs
Suggested reviewers
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)
languagetool-language-modules/pt/src/main/resources/org/languagetool/rules/pt/grammar.xml (3)
1063-1076
: LGTM! Consider removing the ChatGPT comment.The rule structure is well-formed and follows the expected format for LanguageTool rules. The default state of 'temp_off' is appropriate for a new rule that may need further testing.
Consider removing the comment about using ChatGPT (line 1064) as it's not necessary for the rule's functionality and may not be relevant in the long term.
1065-1071
: LGTM! Consider improving readability of long regex patterns.The pattern matching logic is comprehensive and well-structured. It effectively captures the intended usage of "demasiado" with various verbs and adjectives.
For improved readability, consider breaking the long regex patterns for verbs (line 1066) and adjectives (line 1070) into multiple lines or storing them in separate variables. This can make future maintenance easier.
1074-1075
: Consider adding an example with "demasiados".The current examples effectively demonstrate the rule's application for "demasiada". However, the pattern also matches "demasiados".
For completeness, consider adding a third example that shows the correction of "demasiados" to "demasiado". For instance:
<example correction="demasiado">Estes problemas são <marker>demasiados</marker> complexos.</example>This would cover all cases matched by the pattern.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- languagetool-language-modules/pt/src/main/resources/org/languagetool/rules/pt/grammar.xml (1 hunks)
🔇 Additional comments (1)
languagetool-language-modules/pt/src/main/resources/org/languagetool/rules/pt/grammar.xml (1)
1072-1073
: LGTM! Clear and concise message and suggestion.The error message clearly explains the grammar rule, and the suggestion provides the correct form. This is well-implemented and should be helpful for users.
<rule id='DEMASIADO_INVARIAVEL' name="Demasiada → demasiado" default='temp_off'> | ||
<!-- Used ChatGPT 4o for enhancements and extra accuracy --> | ||
<pattern> | ||
<token regexp='yes' inflected='yes'>andar|continuar|estar|ficar|manter|parecer|revelar|ser|soar|tornar</token> | ||
<marker> | ||
<token regexp='yes'>demasiadas?|demasiados</token> | ||
</marker> | ||
<token regexp='yes' inflected='yes'>real|forte|pesado|triste|rápido|perigoso|complicado|difícil|fácil|lento|quente|frio|importante|grave|curioso|interessante|estranho|amargo|doce|justo|injusto|profundo|superficial|óbvio|sério|simples|longo|curto|chato|intenso|delicado|bonito|feio|útil|inútil|ridículo|vazio|cheio|certo|errado</token> | ||
</pattern> | ||
<message>O adjetivo "demasiado" é invariável quando usado para intensificar adjetivos, como "real".</message> | ||
<suggestion>demasiado</suggestion> | ||
<example correction="demasiado">Esta dor é <marker>demasiada</marker> real.</example> | ||
<example correction="demasiado">Estas dores são <marker>demasiada</marker> reais.</example> | ||
</rule> |
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.
💡 Codebase verification
Testing Strategy Updated with Identified Cases
The search identified several sentences containing 'demasiada' or 'demasiados' followed by an adjective. To ensure the grammar rule effectively handles these cases:
-
Include Identified Sentences as Test Cases:
- Add the following sentences to your test suite to validate the rule:
Foi-lhe dada demasiada importância até que surgira uma nova teoria.
Foi-lhes dada demasiada importância até que surgiram novas teorias.
Son demasiados niñas.
Se lamenta de que hay demasiadas preguntas y demasiado pocas respuestas.
Tienes demasiadas esperanzas puestas en ella.
- Add the following sentences to your test suite to validate the rule:
-
Implement Monitoring for Identified Cases:
- Track the rule's performance on these sentences to identify any false positives or negatives.
- Collect user feedback specifically related to these instances to refine the rule further.
This approach will help in fine-tuning the grammar rule and ensuring its accuracy in real-world scenarios.
🔗 Analysis chain
Suggest testing strategy and monitoring plan.
The rule is well-implemented and ready for testing. To ensure its effectiveness and catch any potential issues:
-
Run the following script to find potential test cases in the existing corpus:
-
Once the rule is activated, consider implementing a monitoring plan to track:
- False positives: Cases where the rule incorrectly flags proper usage.
- False negatives: Cases where incorrect usage is not caught by the rule.
- User feedback: Any comments or reports from users about the rule's behavior.
This will help in fine-tuning the rule and ensuring its accuracy in real-world usage.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for sentences containing 'demasiada' or 'demasiados' followed by an adjective
rg -i "demasiada\w?\s+\w+[oa](\s|\.)" --type txt
Length of output: 50
Script:
#!/bin/bash
# Search for sentences containing 'demasiada' or 'demasiados' followed by an adjective in multiple file types
rg -i "demasiada\w?\s+\w+[oa]" --type-add 'all:*.txt,*.xml,*.md,*.java,*.js,*.py' -g '*' --ignore-case
Length of output: 164
Script:
#!/bin/bash
# Search for sentences containing 'demasiada' or 'demasiados' followed by an adjective in multiple file types
rg -i "demasiada\w?\s+\w+[oa]" -g "*.txt" -g "*.xml" -g "*.md" -g "*.java" -g "*.js" -g "*.py" --ignore-case
Length of output: 1589
Hello, @susanaboatto and @p-goulart ,
Here is the second rule I talked about in the previous pull request.
Thanks!
Summary by CodeRabbit
DEMASIADO_INVARIAVEL
, which corrects the usage of "demasiado" when intensifying adjectives.