Back to LanguageTool Homepage - Privacy - Imprint

Highlight only the last token of max='-1' attribute

Hello,
e.g., Oh kind dear We are running out of time.
For the above example sentence,
Interjection (Oh) followed by adverbs (kind dear)(max=’-1’).
The rule highlights all the adverbs (max=’-1’ postag=RB).

Is there a way to highlight only the last token of the max=’-1’ attribute?
That is to highlight only “dear” not “kind dear”

Thanks!

Hi,

you can try doing something like this:

<rule id="example_rule" name="example_rule">
 <pattern>
  <token>oh</token>
  <token max='-1' postag="JJ"><exception scope="next" negate_pos="yes" postag="JJ"></exception></token>
  <marker>
  <token postag="JJ"></token>
  </marker>
  <token negate="yes">!</token>
 </pattern>
 <message>Use <suggestion><match no="3"></match>!</suggestion></message>
 <example correction='dear!'>Oh kind <marker>dear</marker> We are running out of time.</example>
 <example>Oh kind dear! We are running out of time.</example>
</rule>

Thanks for your response @BebraiPuola . It works fine.