Back to LanguageTool Homepage - Privacy - Imprint

Rule application on words with multiple tags


(Praneet Khandelwal) #1

Does anyone know how any rule is matched if a word is tagged for multiple tags?

<rule>
                <antipattern>
                    <token postag="RB"/>
                    <token postag="VB.*" postag_regexp="yes"/>
                </antipattern>
                <antipattern>
                    <token postag="NN|NN:.*" postag_regexp="yes"/>
                    <token>that</token>
                </antipattern>
                <pattern>
                    <token postag="SENT_START"/>
                    <token postag="DT"><exception regexp="yes">these|those</exception></token>
                    <token postag="NN|NN:.*" postag_regexp="yes"><exception postag="JJ|MD|NNS" postag_regexp="yes"/><exception regexp="yes">rest|latter|jury|committee|government|might|can</exception></token>
                    <marker>
                        <token postag="VB|VBP" postag_regexp="yes"><exception postag="VBZ|VBN|VBD|VBG|JJ|MD" postag_regexp="yes"/></token>
                    </marker>
                    <token postag="DT|JJ" postag_regexp="yes"><exception postag="VB.*" postag_regexp="yes"/></token>
                </pattern>
                <message>Possible agreement error - use third-person verb forms for singular and mass nouns: <suggestion><match no="5" postag="VBZ"/></suggestion>.</message>

For this, one of the given correct examples is
An evening glow often promises good weather.
I think this sentence satisfies the rule pattern, but it does not seem to and so does not raise any flag.


(Yakov) #2

Without this antipattern rule work fine:

<antipattern>
     <token postag="RB"/>
     <token postag="VB.*" postag_regexp="yes"/>
</antipattern>

(Praneet Khandelwal) #3

Yeah it works when you do that.
Also if I don't remove the antipattern, instead I commented the last token (DT|JJ), it raised a flag even when the antipattern was there.

<rule>
                <antipattern>
                    <token postag="RB"/>
                    <token postag="VB.*" postag_regexp="yes"/>
                </antipattern>
                <antipattern>
                    <token postag="NN|NN:.*" postag_regexp="yes"/>
                    <token>that</token>
                </antipattern>
                <pattern>
                    <token postag="SENT_START"/>
                    <token postag="DT"><exception regexp="yes">these|those</exception></token>
                    <token postag="NN|NN:.*" postag_regexp="yes"><exception postag="JJ|MD|NNS" postag_regexp="yes"/><exception regexp="yes">rest|latter|jury|committee|government|might|can</exception></token>
                    <marker>
                        <token postag="VB|VBP" postag_regexp="yes"><exception postag="VBZ|VBN|VBD|VBG|JJ|MD" postag_regexp="yes"/></token>
                    </marker>
                    <!-- <token postag="DT|JJ" postag_regexp="yes"><exception postag="VB.*" postag_regexp="yes"/></token> -->
                </pattern>
                <message>Possible agreement error - use third-person verb forms for singular and mass nouns: <suggestion><match no="5" postag="VBZ"/></suggestion>.</message>
</rule>