use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestSpanSequenceQueryJSON method queryJSONkoralOptionalityAfterEmptyBug.
@Test
public void queryJSONkoralOptionalityAfterEmptyBug() throws QueryException {
// Sonne [] Mond?
SpanQueryWrapper sqwi = jsonQueryFile("empty-followed-by-optionality.jsonld");
assertEquals("focus(254: spanContain(<tokens:base/s:t />, {254: spanOr([spanExpansion(tokens:s:Sonne, []{1, 1}, right), spanNext(spanExpansion(tokens:s:Sonne, []{1, 1}, right), tokens:s:Mond)])}))", sqwi.toQuery().toString());
// Could also be a distance at the end ... that's a query planner thing.
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestSpanSequenceQueryJSON method queryJSONkoralOptionalityInDistanceBug.
@Test
public void queryJSONkoralOptionalityInDistanceBug() {
try {
// Sonne [] Mond?
SpanQueryWrapper sqwi = jsonQueryFile("distance-with-optionality.jsonld");
sqwi.toQuery().toString();
} catch (QueryException qe) {
assertEquals("Distance constraints not supported with empty, optional or negative operands", qe.getMessage());
}
// Could also be a distance at the end ... that's a query planner thing.
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestSpanSequenceQueryJSON method queryJSONseqEmptyStart.
@Test
public void queryJSONseqEmptyStart() throws QueryException {
SpanQueryWrapper sqwi = jsonQueryFile("empty-first.jsonld");
// [][tt/p=NN]
assertEquals(sqwi.toQuery().toString(), "spanExpansion(tokens:tt/p:NN, []{1, 1}, left)");
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestSpanSequenceQueryJSON method queryJSONseqNegativeEnd.
@Test
public void queryJSONseqNegativeEnd() throws QueryException {
SpanQueryWrapper sqwi = jsonQueryFile("negative-last.jsonld");
// [tt/p=NN][tt/p!=NN]
assertEquals(sqwi.toQuery().toString(), "focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(tokens:tt/p:NN, !tokens:tt/p:NN{1, 1}, right)}))");
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestSpanSequenceQueryJSON method queryJSONseqEmptyEnd.
@Test
public void queryJSONseqEmptyEnd() throws QueryException {
SpanQueryWrapper sqwi = jsonQueryFile("empty-last.jsonld");
assertEquals(sqwi.toQuery().toString(), "focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(tokens:s:der, []{1, 1}, right)}))");
}
Aggregations