languagetool-org / languagetool

Style and Grammar Checker for 25+ Languages
https://languagetool.org
GNU Lesser General Public License v2.1
12.41k stars 1.39k forks source link

[en] Cannot deactivate (turn off) the Java rule for compounds #10043

Open MikeUnwalla opened 10 months ago

MikeUnwalla commented 10 months ago

This problem is in the latest snapshot and earlier (2023-11-22 and possibly before that date).

Sample text for Text Language English (American).: ... into the tree of life's radiate rainbow colored leaves.

image

Neither the dropdown option 'Turn off Rule' nor 'deactivate' do anything. I cannot deactivate the rule.

Click 'More', then 'Rule details...' and I see the message No rule with id EN_COMPOUNDS_RAINBOW_COLORED, subId null: image

BrE has a similar problem with 'rainbow coloured'.

jaumeortola commented 10 months ago

The real ID of the Java rule is EN_COMPOUNDS, but deactivating this ID will deactivate all matches for compounds in compounds.txt. EN_COMPOUNDS_RAINBOW_COLORED is a fake rule ID that we created for statistical purposes only.

If you really need to disable the rule for rainbow-colored, we would need to remove it from compounds.txt, and create a specific XML rule that can be disabled.

MikeUnwalla commented 10 months ago

@jaumeortola, thank you for your explanation.

The fact that EN_COMPOUNDS_RAINBOW_COLOREDis a fake ID is not important to the user. I think that the LT team should correct these errors:

Please do not become too like Microsoft. You do not know the use cases of the users. I want to deselect the rule for compounds (not only 'rainbow colored') because the LT analysis hides other errors that my (style) rules find.

For example, think about this text: The rainbow colored the sky with beauty.

The LT analysis is not correct. 'colored' is a verb, and the tagger shows it as a verb. There must be no hyphen between 'rainbow' and 'colored'. image

Because I cannot deselect the LT rule, the analysis for my rule about the word 'colored' is hidden below the analysis from the LT rule. With one sentence, the hiding is not a problem. With hundreds of sentences, it is not easy to see (in the top part of the GUI) the errors that my rules find.

jaumeortola commented 10 months ago

All expressions in compounds.txt should be unambiguous. If there are ambiguous sentences like this:

The rainbow colored the sky with beauty.

The right thing to do is to remove the line from compounds.txt and to write an XML rule that considers the context. @AzadehSafakish

The solution for selecting/deselecting the rules consistently won't be trivial. I don't know how it could be solved. @danielnaber