Hello All,

Rule NOUN_SUFFIX_TEST-OK below gives the results that I expect. Testrules gives 
no error message.

In NOUN_SUFFIX_TEST-NOT-OK below, I replaced 'color' with '[a-z]+', testrules 
gives this error (in part):
Running pattern rule tests for English... Exception in thread "main" 
junit.framework.AssertionFailedError: English rule
NOUN_SUFFIX_TEST-NOT-OK[1]:
"... but colorwise, the diagram is satisfactory."
Errors expected: 1
Errors found   : 0

I cannot see what I am doing wrong. Any suggestions?

    <rule id="NOUN_SUFFIX_TEST-OK" name="Noun suffix test OK">
      <pattern>
        <token regexp="yes">(color)(?:ise|wise)</token>
      </pattern>
      <filter class="org.languagetool.rules.en.EnglishPartialPosTagFilter"
            args="no:1 regexp:(color)(?:ise|wise) postag_regexp:NN.*"/>
      <message>The singular noun is <match no="1" 
regexp_match="(color)(?:ise|wise)" regexp_replace="$1" 
case_conversion="allupper"/>. Noun+suffix is '<match no="1"/>'.</message>
      <short>Noun + suffix test OK</short>
      <example type="correct">The <marker>colorised</marker> illustration 
is...</example>
      <example type="correct">Cut the long cover 
<marker>lengthwise</marker>.</example>
      <example correction="" type="incorrect">To increase the quality of the 
document, <marker>colorise</marker> the diagrams.</example>
      <example correction="" type="incorrect">... but 
<marker>colorwise</marker>, the diagram is satisfactory.</example>
    </rule>

    <rule id="NOUN_SUFFIX_TEST-NOT-OK" name="Noun suffix test not OK">
      <pattern>
        <token regexp="yes">([a-z]+)(?:ise|wise)</token>
      </pattern>
      <filter class="org.languagetool.rules.en.EnglishPartialPosTagFilter"
            args="no:1 regexp:([a-z]+)(?:ise|wise) postag_regexp:NN.*"/>
      <message>The singular noun is <match no="1" 
regexp_match="([a-z]+)(?:ise|wise)" regexp_replace="$1" 
case_conversion="allupper"/>. Noun+suffix is '<match no="1"/>'.</message>
      <short>Noun + suffix test not OK</short>
      <example type="correct">The <marker>colorised</marker> illustration 
is...</example>
      <example type="correct">Cut the long cover 
<marker>lengthwise</marker>.</example>
      <example correction="" type="incorrect">To increase the quality of the 
document, <marker>colorise</marker> the diagrams.</example>
      <example correction="" type="incorrect">... but 
<marker>colorwise</marker>, the diagram is satisfactory.</example>
    </rule>

Regards,

Mike Unwalla
Contact: www.techscribe.co.uk/techw/contact.htm 




------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Languagetool-devel mailing list
Languagetool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/languagetool-devel

Reply via email to