Skip to content

Commit

Permalink
fix #321 (negated metadata queries don't work any longer)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaskrause committed May 14, 2014
1 parent acee1e4 commit 6e6c130
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion annis-service/src/main/antlr4/annis/ql/AqlParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ expr
| variableExpr # VariableTermExpr
| unary_linguistic_term # UnaryTermExpr
| n_ary_linguistic_term # BinaryTermExpr
| META DOUBLECOLON id=qName op=EQ txt=textSpec # MetaTermExpr
| META DOUBLECOLON id=qName op=(EQ|NEQ) txt=textSpec # MetaTermExpr
;

andTopExpr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void enterMetaTermExpr(AqlParser.MetaTermExprContext ctx)
null : ctx.id.namespace.getText();
String name = ctx.id.name.getText();
String value = textFromSpec(ctx.txt);
QueryNode.TextMatching textMatching = textMatchingFromSpec(ctx.txt, false);
QueryNode.TextMatching textMatching = textMatchingFromSpec(ctx.txt, ctx.NEQ() != null);

QueryAnnotation anno = new QueryAnnotation(namespace,
name, value, textMatching);
Expand Down
2 changes: 2 additions & 0 deletions annis-service/src/test/java/annis/CountTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ public void testAQLTestSuitePcc2()
assertEquals(2, countPcc2("cat=\"CS\" >[func=\"CJ\"] cat=\"S\" > \"was\""));
assertEquals(1, countPcc2("cat=\"CS\" >[func=\"CJ\"] cat=\"S\" >secedge \"was\""));
assertEquals(1, countPcc2("pos=/V.FIN/ ->dep[func=\"sbj\"] \"Jugendliche\" & cat=\"S\" & #3 >secedge #2 | \"ja\""));
assertEquals(187, countPcc2("tok & meta::Titel=\"Steilpass\""));
assertEquals(212, countPcc2("tok & meta::Titel!=\"Steilpass\""));

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
<value><![CDATA[pos!=//]]></value>
<value><![CDATA[tok !=""]]></value>
<value><![CDATA[tok!=//]]></value>
<value><![CDATA[tok & meta::Titel!="Steilpass"]]></value>
</util:list>

<util:list id="bad">
Expand Down

0 comments on commit 6e6c130

Please sign in to comment.