Back to LanguageTool Homepage - Privacy - Imprint

Immunization for disambiguation: empty line affects the disambiguation

I want to make disambiguation rules that immunize XML code. This rule immunizes an XML declaration:

<rule id="IMMUNIZE_XML_DECLARATION" name="Immunize XML declaration">
            <token regexp="yes">&lt;</token>
            <token min="0" max="20"/>
            <token regexp="yes">&gt;</token>
    <disambig action="immunize"/>

But, if the lines of XML code are not separated by an empty line, I see this:

I don’t understand why the rule does not work if there is no blank line. Do you have ideas/suggestions?

How can it tell that the code line ends when there are no paragraph breaks? (this could play havoc with the token count)


Forget about code. The disambiguation rule could be for anything. The disambiguation rule does not have a token for SENT_END. Where the line ends is not part of the rule.

The text in line 1 is immunized. The text in line 4 is not immunized:

Is it possible to write a disambiguation rule such that the text in line 4 that is between < and > is immunized, or is code-like text a special case?