Search in sources :

Example 11 with SpanAlterQueryWrapper

use of de.ids_mannheim.korap.query.wrap.SpanAlterQueryWrapper in project Krill by KorAP.

the class TestSpanSegmentAlterQuery method spanAlterQuery3.

@Test
public void spanAlterQuery3() throws QueryException {
    SpanAlterQueryWrapper ssaquery = new SpanAlterQueryWrapper("field");
    ssaquery.or("b").or("c").or("d");
    assertEquals("spanOr([field:b, field:c, field:d])", ssaquery.toQuery().toString());
}
Also used : SpanAlterQueryWrapper(de.ids_mannheim.korap.query.wrap.SpanAlterQueryWrapper) Test(org.junit.Test)

Example 12 with SpanAlterQueryWrapper

use of de.ids_mannheim.korap.query.wrap.SpanAlterQueryWrapper in project Krill by KorAP.

the class TestSpanSegmentAlterQuery method spanAlterQuery5.

@Test
public void spanAlterQuery5() throws QueryException {
    SpanRegexQueryWrapper srequery = new SpanRegexQueryWrapper("field", "a[bc]d.?e");
    SpanAlterQueryWrapper ssaquery = new SpanAlterQueryWrapper("field");
    ssaquery.or("f").or(srequery).or("g");
    assertEquals("spanOr([field:f, SpanMultiTermQueryWrapper(field:/a[bc]d.?e/), field:g])", ssaquery.toQuery().toString());
}
Also used : SpanRegexQueryWrapper(de.ids_mannheim.korap.query.wrap.SpanRegexQueryWrapper) SpanAlterQueryWrapper(de.ids_mannheim.korap.query.wrap.SpanAlterQueryWrapper) Test(org.junit.Test)

Example 13 with SpanAlterQueryWrapper

use of de.ids_mannheim.korap.query.wrap.SpanAlterQueryWrapper in project Krill by KorAP.

the class TestSpanSegmentAlterQuery method spanAlterQuery.

@Test
public void spanAlterQuery() throws QueryException {
    SpanAlterQueryWrapper ssaquery = new SpanAlterQueryWrapper("field");
    ssaquery.or("b");
    assertEquals("field:b", ssaquery.toQuery().toString());
}
Also used : SpanAlterQueryWrapper(de.ids_mannheim.korap.query.wrap.SpanAlterQueryWrapper) Test(org.junit.Test)

Aggregations

SpanAlterQueryWrapper (de.ids_mannheim.korap.query.wrap.SpanAlterQueryWrapper)13 Test (org.junit.Test)11 SpanRegexQueryWrapper (de.ids_mannheim.korap.query.wrap.SpanRegexQueryWrapper)4 SpanSegmentQueryWrapper (de.ids_mannheim.korap.query.wrap.SpanSegmentQueryWrapper)4 JsonNode (com.fasterxml.jackson.databind.JsonNode)2 SpanQueryWrapper (de.ids_mannheim.korap.query.wrap.SpanQueryWrapper)2 QueryException (de.ids_mannheim.korap.util.QueryException)2 SpanWithAttributeQueryWrapper (de.ids_mannheim.korap.query.wrap.SpanWithAttributeQueryWrapper)1 ArrayList (java.util.ArrayList)1