use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestSpanSubspanQueryJSON method testEmptyMinusStartOffset.
@Test
public void testEmptyMinusStartOffset() throws QueryException {
// no optimization
// submatch(-1,4:der []{1,8})
String filepath = getClass().getResource("/queries/submatch/empty-minusStart.jsonld").getFile();
SpanQueryWrapper sqwi = getJSONQuery(filepath);
SpanQuery sq = sqwi.toQuery();
assertEquals("subspan(spanExpansion(tokens:s:der, []{1, 8}, right), -1, 4)", sq.toString());
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestSpanSubspanQueryJSON method testNegativeSequence.
@Test
public void testNegativeSequence() throws QueryException {
// das submatch(0,1:[base != Baum])
String filepath = getClass().getResource("/queries/submatch/negative-seq.jsonld").getFile();
SpanQueryWrapper sqwi = getJSONQuery(filepath);
SpanQuery sq = sqwi.toQuery();
assertEquals("focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(tokens:s:das, !tokens:l:Baum{1, 1}, right)}))", sq.toString());
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestSpanSubspanQueryJSON method testNegativeRepetition.
@Test
public void testNegativeRepetition() throws QueryException {
// das submatch(1,4:[base != Baum]{1,3})
String filepath = getClass().getResource("/queries/submatch/negative-repetition.jsonld").getFile();
SpanQueryWrapper sqwi = getJSONQuery(filepath);
SpanQuery sq = sqwi.toQuery();
assertEquals("focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(tokens:s:das, !tokens:l:Baum{2, 2}, right)}))", sq.toString());
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestSpanSubspanQueryJSON method testNoLength.
@Test
public void testNoLength() throws QueryException {
// submatch(1,:<s>)
String filepath = getClass().getResource("/queries/submatch/noLength.jsonld").getFile();
SpanQueryWrapper sqwi = getJSONQuery(filepath);
SpanQuery sq = sqwi.toQuery();
assertEquals("subspan(<tokens:s />, 1, 0)", sq.toString());
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestSpanSubspanQueryJSON method testElementQuery.
@Test
public void testElementQuery() throws QueryException {
// submatch(1,4:<s>)
String filepath = getClass().getResource("/queries/submatch/simpleElement.jsonld").getFile();
SpanQueryWrapper sqwi = getJSONQuery(filepath);
SpanQuery sq = sqwi.toQuery();
assertEquals("subspan(spanContain(<tokens:s />, tokens:tt/l:Haus), 1, 4)", sq.toString());
}
Aggregations