use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestSpanSequenceQueryJSON method queryJSONseqEmptyStartClass.
@Test
public void queryJSONseqEmptyStartClass() throws QueryException {
SpanQueryWrapper sqwi = jsonQueryFile("empty-first-class.jsonld");
// {2:[]}[tt/p=NN]
assertEquals(sqwi.toQuery().toString(), "spanExpansion(tokens:tt/p:NN, []{1, 1}, left, class:2)");
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestSpanSequenceQueryJSON method queryJSONseqEmptySurroundClass2.
@Test
public void queryJSONseqEmptySurroundClass2() throws QueryException {
SpanQueryWrapper sqwi = jsonQueryFile("empty-surround-class-2.jsonld");
// {3:[]}[tt/p=NN]{2:[]}
assertEquals(sqwi.toQuery().toString(), "focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(spanExpansion(tokens:tt/p:NN, []{1, 1}, left, class:3), []{1, 1}, right, class:2)}))");
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestSpanWithAttributeJSON method testElementMultipleOrAttributes.
@Test
public void testElementMultipleOrAttributes() throws QueryException {
String filepath = getClass().getResource("/queries/attribute/element-multiple-or-attributes.jsonld").getFile();
SpanQueryWrapper sqwi = getJSONQuery(filepath);
SpanQuery sq = sqwi.toQuery();
assertEquals("spanOr([spanElementWithAttribute(<tokens:div />, spanAttribute(tokens:type:Zeitschrift)), " + "spanElementWithAttribute(<tokens:div />, spanAttribute(tokens:complete:Y)), " + "spanElementWithAttribute(<tokens:div />, spanAttribute(tokens:n:0))])", sq.toString());
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestSpanWithAttributeJSON method testElementSingleNotAttribute.
@Test
public void testElementSingleNotAttribute() throws QueryException {
String filepath = getClass().getResource("/queries/attribute/element-single-not-attribute.jsonld").getFile();
SpanQueryWrapper sqwi = getJSONQuery(filepath);
SpanQuery sq = sqwi.toQuery();
assertEquals("spanElementWithAttribute(<tokens:head />, spanAttribute(!tokens:type:top))", sq.toString());
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestSpanWithAttributeJSON method testElementMultipleAndNotAttributes.
@Test
public void testElementMultipleAndNotAttributes() throws QueryException {
String filepath = getClass().getResource("/queries/attribute/element-multiple-and-not-attributes.jsonld").getFile();
SpanQueryWrapper sqwi = getJSONQuery(filepath);
SpanQuery sq = sqwi.toQuery();
assertEquals("spanElementWithAttribute(<tokens:div />, [spanAttribute(tokens:type:Zeitschrift), " + "spanAttribute(!tokens:complete:Y), spanAttribute(tokens:n:0)])", sq.toString());
}
Aggregations