Back to LanguageTool Homepage - Privacy - Imprint

Weird tagging error?

Hi,

I’m getting a weird response when I try one of my own rules. Here’s the rule, and in the image the result. The difference in the two phrases seems to be the {!} which tails the NP chunk in the first sentence. I’ve searched the site but haven’t found out what it means.

Thanks

        <rule id="NON-USE_OF_PRESENT_PERFECT_WITH_SINCE" name="present tense + for/since">
            <pattern>
              <marker>
                <token postag="VBP|VBZ|VBD" postag_regexp="yes"><exception>got</exception><exception postag="VBN"/></token>
                <token postag="RB|RBR|JJ|NNS|NNP|NNPS|NN:U|NN:UN|PRP|VBN" postag_regexp="yes"></token>
                <token>since</token>
                <token postag="PRP"></token>
                <token regexp="yes">was|were</token>
              </marker>
            </pattern>
            <message>When we talk how long something HAS LASTED, we use the present perfect.</message>
            <suggestion>have/has <match no="1" postag="VBN"/> \2 since</suggestion>
        </rule>

Hi Alan, {!} means the token was immunized by a disambiguation rule with <disambig action="immunize"/>.

OK, thanks… I’ll have to read up on that, but obviously that immunization is making a difference when it comes to applying the rule.

How can it be fixed?

Well, it cannot be fixed without changing the disambiguation rules. There were some immunization rules used to make CD_NN rule to work correctly. I went ahead and made some changes right now. Your rule should now match :slight_smile:

Thanks, yes I found it and added an exception which solves this particular problem… I assume it won’t affect any other rules negatively.

    <rule name="Immunize age" id="X_WAS_CD">
        <token><exception>since</exception></token>
      <pattern>
        <token regexp="yes">s?he|you|I|we|they|it</token>
        <token inflected="yes">be</token>
        <token postag="CD"/>
      </pattern>
      <disambig action="immunize"/>
    </rule>

Actually, you don’t need this any more. It’s removed from the disambiguation rules in the repository.

1 Like

I assume you mean for when I upgrade. I’m not using the latest version of LT yet.

Thanks very much for your help

I mean in the github repository (or in the nightly build).