use of de.ids_mannheim.korap.query.wrap.SpanSequenceQueryWrapper in project Krill by KorAP.
the class TestSpanWithinQuery method spanSegmentWithinQuery.
@Test
public void spanSegmentWithinQuery() throws QueryException {
SpanSequenceQueryWrapper ssquery = new SpanSequenceQueryWrapper("field", "a", "b", "c");
SpanWithinQuery ssequery = new SpanWithinQuery("s", ssquery.toQuery());
assertEquals("spanContain(<field:s />, spanNext(spanNext(field:a, field:b), field:c))", ssequery.toString());
ssquery = new SpanSequenceQueryWrapper("field", "a", "b");
ssequery = new SpanWithinQuery("p", ssquery.toQuery());
assertEquals("spanContain(<field:p />, spanNext(field:a, field:b))", ssequery.toString());
}
use of de.ids_mannheim.korap.query.wrap.SpanSequenceQueryWrapper in project Krill by KorAP.
the class TestSpanWithinQuery method spanSegmentStartsWithQuery.
@Test
public void spanSegmentStartsWithQuery() throws QueryException {
SpanSequenceQueryWrapper ssquery = new SpanSequenceQueryWrapper("field", "a", "b", "c");
SpanWithinQuery ssequery = new SpanWithinQuery(new SpanElementQuery("field", "s"), ssquery.toQuery(), SpanWithinQuery.STARTSWITH, true);
assertEquals("spanStartsWith(<field:s />, spanNext(spanNext(field:a, field:b), field:c))", ssequery.toString());
}
use of de.ids_mannheim.korap.query.wrap.SpanSequenceQueryWrapper in project Krill by KorAP.
the class TestSpanSegmentSequenceQuery method spanSegmentSequenceQueryPrepend2.
@Test
public void spanSegmentSequenceQueryPrepend2() throws QueryException {
SpanSequenceQueryWrapper sssq = new SpanSequenceQueryWrapper("field", "d", "e");
SpanSegmentQueryWrapper ssq = new SpanSegmentQueryWrapper("field", "-a", "-b", "-c");
sssq.prepend(ssq);
assertEquals("spanNext(spanNext(spanSegment(spanSegment(field:-a, field:-b), field:-c), field:d), field:e)", sssq.toQuery().toString());
}
use of de.ids_mannheim.korap.query.wrap.SpanSequenceQueryWrapper in project Krill by KorAP.
the class TestSpanSegmentSequenceQuery method spanSegmentSequenceQuery3.
@Test
public void spanSegmentSequenceQuery3() throws QueryException {
SpanSequenceQueryWrapper sssq = new SpanSequenceQueryWrapper("field", "a", "b");
SpanRegexQueryWrapper ssreq = new SpanRegexQueryWrapper("field", "c.?d");
sssq.append(ssreq);
assertEquals("spanNext(spanNext(field:a, field:b), SpanMultiTermQueryWrapper(field:/c.?d/))", sssq.toQuery().toString());
}
Aggregations