-
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-PT] Improved rule ID:AVIÃO_DE_COMBATE_PT_PT (regexp+suggestion) #10949
Conversation
WalkthroughThe pull request introduces significant modifications to 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: 0
🧹 Outside diff range and nitpick comments (4)
languagetool-language-modules/pt/src/main/resources/org/languagetool/rules/pt/pt-PT/style.xml (4)
Line range hint
4111-4132
: Great improvements to the 'CHEGAR_AO_FIM_FINDAR_TERMINAR' rule!The changes enhance the rule's structure and functionality:
- The addition of rule ID, name, and type attributes improves the rule's metadata and manageability.
- The pattern and message modifications refine the rule's application and suggestion.
One minor suggestion for improvement:
Consider adding an
url
attribute to the rule, pointing to a reliable source that explains the stylistic preference for "findar/terminar/acabar" over "chegar ao fim". This would provide users with additional context and justification for the suggestion.Example:
<url>https://example.com/portuguese-style-guide#prefer-concise-verbs</url>
Line range hint
4134-4173
: Well-structured improvements to the 'SIMPLIFICAR_DE_VOCÊS_VOSSA_VOSSAS_VOSSO_VOSSOS' rule!The changes enhance the rule's effectiveness and accuracy:
- Splitting the rule into singular and plural subrules allows for more precise handling of different cases.
- The refined patterns and suggestions address various grammatical scenarios more effectively.
These modifications should result in more accurate and contextually appropriate suggestions for users.
A potential enhancement to consider:
To further improve the rule's flexibility, you might want to add a third subrule that handles cases where the possessive adjective is followed by a noun. This would allow for more natural-sounding suggestions in complex phrases.
Example:
<rule> <pattern> <token postag='NC[^C].+' postag_regexp='yes'/> <token inflected='yes'>ser</token> <marker> <token>de</token> <token>você</token> </marker> <token postag='NC.+' postag_regexp='yes'/> </pattern> <message>&simplify_msg;</message> <suggestion><match no='1' postag='NC(..).+' postag_replace='DP3$1S'>seu</match> <match no='5'/></suggestion> </rule>This would handle cases like "O carro de você é bonito" → "O seu carro é bonito".
Line range hint
4175-4188
: Excellent addition of the 'DEPOIS_É_QUE_VERBO_DEPOIS_VERBO_PT_PT' rule!This new rule effectively targets a common verbose construction in Portuguese, promoting more concise writing:
- The pattern accurately identifies the "Depois é que + Verbo" construction.
- The suggestion appropriately simplifies it to "Depois + Verbo".
To further enhance this rule, consider the following suggestion:
Add an
example
element with an incorrect sentence and its correction to provide clear guidance for users and facilitate testing. For instance:<example correction="depois">Estava a fazer exercício e só <marker>depois é que</marker> li o texto dela.</example>This addition would make the rule more user-friendly and easier to verify during testing.
Line range hint
1-4188
: Overall, excellent improvements to the Portuguese style rules!The changes in this file significantly enhance the quality and effectiveness of the style rules for Portuguese in LanguageTool:
- Existing rules have been refined and improved, increasing their accuracy and applicability.
- New rules have been added to address additional style issues, expanding the tool's capabilities.
- The use of advanced tools like ChatGPT 4o for rule enhancement demonstrates a commitment to continuous improvement.
These modifications will result in more precise, helpful, and contextually appropriate suggestions for users, ultimately improving the quality of Portuguese writing.
To further enhance the file:
Consider adding more
example
elements to rules where they are missing, as this helps with user understanding and facilitates testing.As the number of rules grows, it may be beneficial to organize them into more specific categories or separate files based on the type of style issue they address. This could improve maintainability and make it easier for contributors to work on specific areas of the ruleset.
📜 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/pt-PT/style.xml (1 hunks)
🧰 Additional context used
🔇 Additional comments (1)
languagetool-language-modules/pt/src/main/resources/org/languagetool/rules/pt/pt-PT/style.xml (1)
Line range hint
4096-4109
: Excellent enhancement to the 'AVIÃO_DE_COMBATE_PT_PT' rule!The modifications significantly improve the rule's effectiveness and precision:
- The pattern now covers a wider range of terms related to combat aircraft, increasing the rule's applicability.
- The message has been refined to provide more specific guidance on when to use the term "caça".
- The use of ChatGPT 4o for enhancements demonstrates a commitment to leveraging advanced tools for rule improvement.
These changes will likely result in more accurate and helpful suggestions for users.
Just improved the regexp + the suggestion message to make it clearer.
Summary by CodeRabbit