Back to LanguageTool Homepage - Privacy - Imprint

Reorder tokens

Hi,
How can I make this example work

<rule>
    <pattern>
      <marker>
        <token inflected="yes" skip="1">verb1</token>
        <token postag="N.*" postag_regexp="yes" min="0"/> 
        <token>on</token>
     </marker>
    </pattern>
    <message>Did you means 
   <suggestion><match no="1" regexp_match="verb1" regexp_replace="verb2"/> <match no="2"/></suggestion>
</message>
    <example correction="verb2 subject" type="incorrect"><marker>verb1 subject on </marker></example>
    <example correction="verb2" type="incorrect"><marker>verb1 on </marker> </example>

    <example type="correct"> verb2 subject </example>
  </rule>

Hi, I don’t known if there is another way, but you can split your rule into two and then add them to <rulegroup>:

<rulegroup id='test' name='test'>
<rule>
    <pattern>
      <marker>
        <token inflected="yes" skip="1">verb1</token>
        <token postag="N.*" postag_regexp="yes"/> 
        <token>on</token>
     </marker>
    </pattern>
    <message>Did you mean <suggestion><match no="1" regexp_match="verb1" regexp_replace="verb2"/> <match no="2"/></suggestion>
</message>
    <example correction="verb2 subject" type="incorrect"><marker>verb1 subject on</marker></example>
    <example type="correct"> verb2 subject </example>
  </rule>
<rule>
    <pattern>
      <marker>
        <token inflected="yes" skip="1">verb1</token>
        <token>on</token>
     </marker>
    </pattern>
    <message>Did you mean <suggestion><match no="1" regexp_match="verb1" regexp_replace="verb2"/></suggestion>
</message>
    <example correction="verb2" type="incorrect"><marker>verb1 on</marker></example>
    <example type="correct"> verb2 subject </example>
  </rule>  
    
</rulegroup>

Thank you, it works.