languagetool-org / languagetool

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

[en] Java EN_A_VS_AN does not respect disambiguation action ignore_spelling #5986

Open MikeUnwalla opened 2 years ago

MikeUnwalla commented 2 years ago

Java rule EN_A_VS_AN does not respect ignore_spelling (https://dev.languagetool.org/developing-a-disambiguator#ignoring-in-spell-checking-rules).

If a is smaller than b, stop the test.

This rule does not prevent EN_A_VS_AN from giving a warning for the test sentence above:

<rule name="Ignore spelling of 'a' + is" id="A_AND_OR_TEST">
    <pattern>
        <marker>
            <token>a</token>
        </marker>
        <token>is</token>
    </pattern>
  <disambig action="ignore_spelling"/>
</rule>
danielnaber commented 2 years ago

ignore_spelling only refers to the spelling rule, I don't think it's supposed to ignore all other rules. Exceptions like these should instead be added to the specific rule.

MikeUnwalla commented 2 years ago

ignore_spelling only refers to the spelling rule,

Yes. But EN_A_VS_AN is the spelling rule.

danielnaber commented 2 years ago

But EN_A_VS_AN is the spelling rule.

The fact that is has type ITSIssueType.Misspelling is not enough to make it a spelling rule in that sense. Only dictionary-based spelling rules (hunspell/Morfologik) obey the ignore_spelling attribute.

MikeUnwalla commented 2 years ago

Only dictionary-based spelling rules (hunspell/Morfologik) obey the ignore_spelling attribute.

This information is missing from https://dev.languagetool.org/developing-a-disambiguator#ignoring-in-spell-checking-rules.