Search in sources :

Example 11 with SpanSequenceQueryWrapper

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());
}
Also used : SpanWithinQuery(de.ids_mannheim.korap.query.SpanWithinQuery) SpanSequenceQueryWrapper(de.ids_mannheim.korap.query.wrap.SpanSequenceQueryWrapper) Test(org.junit.Test)

Example 12 with SpanSequenceQueryWrapper

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());
}
Also used : SpanWithinQuery(de.ids_mannheim.korap.query.SpanWithinQuery) SpanSequenceQueryWrapper(de.ids_mannheim.korap.query.wrap.SpanSequenceQueryWrapper) SpanElementQuery(de.ids_mannheim.korap.query.SpanElementQuery) Test(org.junit.Test)

Example 13 with SpanSequenceQueryWrapper

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());
}
Also used : SpanSegmentQueryWrapper(de.ids_mannheim.korap.query.wrap.SpanSegmentQueryWrapper) SpanSequenceQueryWrapper(de.ids_mannheim.korap.query.wrap.SpanSequenceQueryWrapper) Test(org.junit.Test)

Example 14 with SpanSequenceQueryWrapper

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());
}
Also used : SpanRegexQueryWrapper(de.ids_mannheim.korap.query.wrap.SpanRegexQueryWrapper) SpanSequenceQueryWrapper(de.ids_mannheim.korap.query.wrap.SpanSequenceQueryWrapper) Test(org.junit.Test)

Aggregations

SpanSequenceQueryWrapper (de.ids_mannheim.korap.query.wrap.SpanSequenceQueryWrapper)14 Test (org.junit.Test)13 KrillIndex (de.ids_mannheim.korap.KrillIndex)3 SpanSegmentQueryWrapper (de.ids_mannheim.korap.query.wrap.SpanSegmentQueryWrapper)3 SpanWithinQuery (de.ids_mannheim.korap.query.SpanWithinQuery)2 SpanRegexQueryWrapper (de.ids_mannheim.korap.query.wrap.SpanRegexQueryWrapper)2 Result (de.ids_mannheim.korap.response.Result)2 QueryException (de.ids_mannheim.korap.util.QueryException)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 SpanElementQuery (de.ids_mannheim.korap.query.SpanElementQuery)1 SpanClassQueryWrapper (de.ids_mannheim.korap.query.wrap.SpanClassQueryWrapper)1 SpanRepetitionQueryWrapper (de.ids_mannheim.korap.query.wrap.SpanRepetitionQueryWrapper)1