use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestSpanSubspanQueryJSON method testCaseEmptyEmbedded.
@Test
public void testCaseEmptyEmbedded() throws QueryException {
// die subspan(der []{1,}, 2,3)
String filepath = getClass().getResource("/queries/submatch/embedded.jsonld").getFile();
SpanQueryWrapper sqwi = getJSONQuery(filepath);
SpanQuery sq = sqwi.toQuery();
assertEquals("spanNext({1: tokens:s:die}, {1: subspan(spanExpansion(" + "tokens:s:der, []{1, 100}, right), 2, 3)})", sq.toString());
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestSpanSubspanQueryJSON method testCaseEmptyWrapped.
@Test
public void testCaseEmptyWrapped() throws QueryException {
String filepath = getClass().getResource("/queries/submatch/wrapped.jsonld").getFile();
SpanQueryWrapper sqwi = getJSONQuery(filepath);
SpanQuery sq = sqwi.toQuery();
assertEquals("focus(129: spanElementDistance({129: tokens:s:der}, {129: subspan" + "(<tokens:s />, 0, 1)}, [(base/s:s[0:0], ordered, notExcluded)]))", sq.toString());
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestSpanSubspanQueryJSON method testCaseEmptyEmbeddedValid.
@Test
public void testCaseEmptyEmbeddedValid() throws QueryException {
// die subspan([]{0,5},2)
String filepath = getClass().getResource("/queries/submatch/embedded-valid-empty.jsonld").getFile();
SpanQueryWrapper sqwi = getJSONQuery(filepath);
SpanQuery sq = sqwi.toQuery();
assertEquals("focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(tokens:s:die, []{2, 5}, right)}))", sq.toString());
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestSpanSequenceQueryJSON method queryJSONseqEmptySurroundRepetition2.
@Test
public void queryJSONseqEmptySurroundRepetition2() throws QueryException {
SpanQueryWrapper sqwi = jsonQueryFile("empty-surround-repetition-2.jsonld");
// []{3,5}[tt/p=NN][]{2,7}
assertEquals(sqwi.toQuery().toString(), "focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(spanExpansion(tokens:tt/p:NN, []{3, 5}, left), []{2, 7}, right)}))");
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestSpanSequenceQueryJSON method queryJSONseqEmptyNegativeOptionalClass.
@Test
public void queryJSONseqEmptyNegativeOptionalClass() throws QueryException {
SpanQueryWrapper sqwi = jsonQueryFile("empty-negative-optional.jsonld");
// der {[pos!=ADJA]*} Mann
assertEquals(sqwi.toQuery().toString(), "spanNext(tokens:s:der, spanExpansion(tokens:s:Mann, !tokens:tt/p:ADJA{0, 100}, left, class:1))");
}
Aggregations