Skip to content
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] Removed "temp_off" from rule ID:OS_DOIS_AS_DUAS_AMBOS_AMBAS #10870

Merged
merged 3 commits into from
Sep 16, 2024

Conversation

marcoagpinto
Copy link
Member

@marcoagpinto marcoagpinto commented Sep 10, 2024

Heya, @susanaboatto and @p-goulart ,

I have removed the temp_off:
https://internal1.languagetool.org/regression-tests/via-http/2024-09-09/pt-BR_full/result_style_OS_DOIS_AS_DUAS_AMBOS_AMBAS%5B1%5D.html

https://internal1.languagetool.org/regression-tests/via-http/2024-09-09/pt-BR_full/result_style_OS_DOIS_AS_DUAS_AMBOS_AMBAS%5B2%5D.html

The results are too many for me to focus on checking one by one, but they look okay.

Thanks!

😛 😛 😛 😛 😛 😛 😛 😛 😛 😛 😛 😛 😛 😛 😛 😛 😛

Summary by CodeRabbit

  • New Features

    • Updated language rules to enable the rule group for "os dois → ambos" by default, enhancing language processing capabilities.
    • Improved specificity of language rules by adding exceptions for the term "precisar" and introducing new antipatterns to reduce false positives.
  • Bug Fixes

    • Removed temporary off state for the specified rule group, ensuring more consistent application of language rules.

Copy link
Contributor

coderabbitai bot commented Sep 10, 2024

Walkthrough

This pull request modifies an XML configuration file that defines language rules for Portuguese. The primary change involves the removal of the default='temp_off' attribute from the <rulegroup> element associated with the rule group OS_DOIS_AS_DUAS_AMBOS_AMBAS, which will now be active by default. Additionally, new <antipattern> elements have been introduced, and existing <rule> elements have been updated to include exceptions for specific tokens, enhancing the specificity and accuracy of the language rules.

Changes

File Path Change Summary
languagetool-language-modules/pt/src/main/resources/.../style.xml Removed default='temp_off' attribute from <rulegroup id='OS_DOIS_AS_DUAS_AMBOS_AMBAS'>, added new <antipattern> elements, and updated <exception> elements for tokens including "precisar".

Possibly related PRs


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@susanaboatto
Copy link
Collaborator

Some matches are still not sitting quite right to me:

Quem escreveu as duas cartas? → Quem escreveu ambas as cartas?

This sounds odd because the output draws attention to the number of letters written, whereas the original question seems to put more emphasis on who wrote them. Maybe let's prevent this rule from matching questions starting with interrogative pronouns (Quem/Quando/Onde/Como).

Also odd:

Essas foram as duas melhores HQs de 2015, na minha opinião. → Essas foram ambas as melhores HQs de 2015, na minha opinião.

The output diminishes the singular focus present in the adjective melhores present in the original phrase. Same issue here: Já em 1904 seriam as duas maiores ferrovias da República → Já em 1904 seriam ambas as maiores ferrovias da República and here: Estas são as duas únicas palavras que não compreendemos. → Estas são ambas as únicas palavras que não compreendemos.

The same problem occurs in more complex comparative/superlative sentences, such as: diz-se que as duas capitais mais próximas uma da outra são Viena (Áustria) e Bratislava (Eslováquia) → diz-se que ambas as capitais mais próximas uma da outra são Viena (Áustria) e Bratislava (Eslováquia)

Só as duas fábricas ocupam juntas uma superfície de mais de 60.000m2 de área construída. → Só ambas as fábricas ocupam juntas uma superfície de mais de 60.000m2 de área construída.

I would rather not have us suggesting "ambas" next to "Só" because it removes the numeric importance of "as duas" here. Think about it like this: if the original was "Só as três fábricas", we couldn't say "Só todas as fabricas", for instance, because it cancels the singularity proposed by the word "só".

The same sort of numeric focus is removed from this example, though it would perhaps be more challenging to resolve:

O tétum e o português formam as duas línguas oficiais do país → O tétum e o português formam ambas as línguas oficiais do país

@marcoagpinto
Copy link
Member Author

@susanaboatto

Ahhhh… that will require more effort/time, I will do it at 5am.

Tomorrow it will be fixed, I hope.

Thank you for the feedback! When the results are too many I lose myself checking one by one.

Thanks!

@marcoagpinto
Copy link
Member Author

@susanaboatto

I have fixed the FPs you reported above and readded "temp_off".

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (1)
languagetool-language-modules/pt/src/main/resources/org/languagetool/rules/pt/style.xml (1)

Line range hint 4-6: Good start, but consider additional antipatterns.

The addition of this antipattern helps address some of the concerns raised in the PR comments by preventing matches for specific article-adjective combinations that could lead to incorrect suggestions. This is a step in the right direction towards improving the rule's accuracy.

However, the PR comments also highlight other problematic cases, such as comparative or superlative contexts, which may not be covered by this antipattern. Consider adding more antipatterns to address these remaining concerns and further refine the rule's behavior.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d1066cd and a018cc6.

Files selected for processing (1)
  • languagetool-language-modules/pt/src/main/resources/org/languagetool/rules/pt/style.xml (3 hunks)
Additional comments not posted (2)
languagetool-language-modules/pt/src/main/resources/org/languagetool/rules/pt/style.xml (2)

Line range hint 1-3: LGTM!

The addition of this antipattern effectively addresses the concern raised in the PR comments about the rule incorrectly matching questions starting with interrogative pronouns. By preventing matches for interrogative words followed by a question mark, the rule's accuracy is improved, reducing false positives.


Line range hint 7-8: Provide rationale for new exceptions and verify impact.

The addition of new exceptions for the token "precisar" and other adjectives aims to enhance the specificity of the rules regarding the usage of "as duas" and "os dois." However, without more context about the motivation behind these specific exceptions, it's difficult to assess their impact on the rule's accuracy.

Could you please provide more information about the rationale for including these particular exceptions? Additionally, I suggest thoroughly verifying the impact of these changes on the rule's behavior to ensure they improve the overall accuracy and don't introduce unintended consequences.

To verify the impact of the new exceptions, consider running the following script:

@marcoagpinto marcoagpinto merged commit 0d061aa into master Sep 16, 2024
5 checks passed
@marcoagpinto marcoagpinto deleted the lt_marcoagpinto_20240910_0633 branch September 16, 2024 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants