Hi Daniel,

I am confused. Does 'nightly build' mean the snapshots on
https://languagetool.org/download/snapshots/?C=M;O=D? If no, what is the
nightly build?

My problem is that testrules gives no errors, but when I put the rule into
my languagetool clone, which I always has the latest LT changes, Maven gives
an error message. The message is indeed 
   Did not expect an error in test sentence: '...', but got: ...

But the message does not help me to find the cause of the problem.

Here is the rule for 'of':
        <rule id="EUPUB_OF" name="of">
            <antipattern>
                <token regexp="yes" inflected="yes">chief|head</token>
                <token>of</token>
                <token regexp="yes"
inflected="yes">department|staff|unit</token>
            </antipattern>
            <pattern>
                <token>of<exception scope="previous"
inflected="yes">dispose</exception></token>
            </pattern>
            <message>Many of our authors use 'of' as an all-purpose
preposition in the place of '<suggestion>from</suggestion>',
'<suggestion>by</suggestion>', '<suggestion>in</suggestion>',
'<suggestion>on</suggestion>', '<suggestion>at</suggestion>' etc., Moreover,
phrases with 'of' are often used instead of possessive '-s' constructions or
noun-noun compounds. This can lead to ambiguity even where it is not
grammatically wrong; for example, in the phrase 'the system of control of
the Commission', is the Commission being controlled (audited?) or is it
doing the controlling?</message>
            <url>http://euenglish.webs.com/</url>
            <short>EU English: of</short>
            <example type="incorrect" correction="from|by|in|on|at">Previous
reports <marker>of</marker> the Court…</example>
            <example>Previous reports <marker>by</marker> the
Court…</example>
            <example type="incorrect"
correction="from|by|in|on|at">Communication <marker>of</marker> the
Commission…</example>
            <example>Communication <marker>from</marker> the
Commission…</example>
            <example type="incorrect" correction="from|by|in|on|at">EC
reports <marker>of</marker> the projects…</example>
            <example>EC reports <marker>on</marker> the projects…</example>
            <example><marker>Dispose of</marker> the waste.</example><!--
Refer to DISPOSE_OF -->
            <example>When you are <marker>disposing of</marker> the waste,
wear protective clothing.</example>
            <example>Each <marker>head of department</marker>
must…</example>
            <example>All <marker>chiefs of units</marker> must…</example>
        </rule>

This is the Maven message:
<snip>
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.languagetool.JLanguageToolTest
Tests run: 9, Failures: 1, Errors: 0, Skipped: 2, Time elapsed: 2.44 sec <<<
FAILURE! - in org.languagetool.JLanguageToo
lTest
testEnglish(org.languagetool.JLanguageToolTest)  Time elapsed: 1.56 sec  <<<
FAILURE!
java.lang.AssertionError: Did not expect an error in test sentence: 'Dog
mushing is more of a sport than a true means of
 transportation.', but got: [EUPUB_OF:20-22:Many of our authors use 'of' as
an all-purpose preposition in the place of '
<suggestion>from</suggestion>', '<suggestion>by</suggestion>',
'<suggestion>in</suggestion>', '<suggestion>on</suggestio
n>', '<suggestion>at</suggestion>' etc., Moreover, phrases with 'of' are
often used instead of possessive '-s' construct
ions or noun-noun compounds. This can lead to ambiguity even where it is not
grammatically wrong; for example, in the ph
rase 'the system of control of the Commission', is the Commission being
controlled (audited?) or is it doing the control
ling?, EUPUB_OF:49-51:Many of our authors use 'of' as an all-purpose
preposition in the place of '<suggestion>from</sugg
estion>', '<suggestion>by</suggestion>', '<suggestion>in</suggestion>',
'<suggestion>on</suggestion>', '<suggestion>at</
suggestion>' etc., Moreover, phrases with 'of' are often used instead of
possessive '-s' constructions or noun-noun comp
ounds. This can lead to ambiguity even where it is not grammatically wrong;
for example, in the phrase 'the system of co
ntrol of the Commission', is the Commission being controlled (audited?) or
is it doing the controlling?] expected:<0> bu
t was:<2>
        at org.junit.Assert.fail(Assert.java:88)
        at org.junit.Assert.failNotEquals(Assert.java:834)
        at org.junit.Assert.assertEquals(Assert.java:645)
        at
org.languagetool.JLanguageToolTest.assertNoError(JLanguageToolTest.java:112)
        at
org.languagetool.JLanguageToolTest.testEnglish(JLanguageToolTest.java:86)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62
)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.
java:50)
        at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.j
ava:12)
        at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.ja
va:47)
        at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.jav
a:17)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
        at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.jav
a:78)
        at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.jav
a:57)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
        at
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:
367)
        at
org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provi
der.java:274)
        at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provide
r.java:238)
        at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:1
61)
        at
org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoade
r(ForkedBooter.java:290)
        at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBoote
r.java:242)
        at
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)

Running org.languagetool.rules.en.EnglishPatternRuleTest
<snip>
Failed tests:
  JLanguageToolTest.testEnglish:86->assertNoError:112 Did not expect an
error in test sentence: 'Dog mushing is more of
a sport than a true means of transportation.', but got: [EUPUB_OF:20-22:Many
of our authors use 'of' as an all-purpose p
reposition in the place of '<suggestion>from</suggestion>',
'<suggestion>by</suggestion>', '<suggestion>in</suggestion>'
, '<suggestion>on</suggestion>', '<suggestion>at</suggestion>' etc.,
Moreover, phrases with 'of' are often used instead
of possessive '-s' constructions or noun-noun compounds. This can lead to
ambiguity even where it is not grammatically w
rong; for example, in the phrase 'the system of control of the Commission',
is the Commission being controlled (audited?
) or is it doing the controlling?, EUPUB_OF:49-51:Many of our authors use
'of' as an all-purpose preposition in the plac
e of '<suggestion>from</suggestion>', '<suggestion>by</suggestion>',
'<suggestion>in</suggestion>', '<suggestion>on</sug
gestion>', '<suggestion>at</suggestion>' etc., Moreover, phrases with 'of'
are often used instead of possessive '-s' con
structions or noun-noun compounds. This can lead to ambiguity even where it
is not grammatically wrong; for example, in
the phrase 'the system of control of the Commission', is the Commission
being controlled (audited?) or is it doing the c
ontrolling?] expected:<0> but was:<2>

Tests run: 64, Failures: 1, Errors: 0, Skipped: 4

[INFO]
------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] languagetool-parent ................................ SUCCESS [  0.400
s]
[INFO] LanguageTool Style and Grammar Checker Core ........ SUCCESS [ 31.073
s]
[INFO] English module for LanguageTool .................... FAILURE [ 30.423
s]
[INFO]
------------------------------------------------------------------------
<snip>

Regards,

Mike

-----Original Message-----
From: Daniel Naber [mailto:daniel.na...@languagetool.org] 
Sent: 15 August 2016 15:31
To: development discussion for LanguageTool
Subject: RE: [en] Maven error when approximately 820 lines are added to
grammar.xml

On 2016-08-15 15:50, Mike Unwalla wrote:

> Sure enough, the exception for 'something' prevents the Maven error
> message. But why? How can I know (without guessing) the cause of a
> Maven error message in the context of the test sentences?

If you're using a recent nightly build, the message should be something 
like:

   Did not expect an error in test sentence: '...', but got: ...

It should display both the sentences and the errors detected. If that 
doesn't work, please post the output of Maven.




------------------------------------------------------------------------------
_______________________________________________
Languagetool-devel mailing list
Languagetool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/languagetool-devel

Reply via email to