use of de.ids_mannheim.korap.query.QueryBuilder in project Krill by KorAP.
the class TestKrillQuery method korapQuerySequenceSegment.
@Test
public void korapQuerySequenceSegment() throws QueryException {
QueryBuilder kq = new QueryBuilder("field");
SpanQuery sq = kq.seq(kq.seg("a").with(kq.or("b", "c"))).append("d").append(kq.re("e.?f")).toQuery();
assertEquals("spanNext(spanNext(spanSegment(field:a, spanOr([field:b, field:c])), field:d), SpanMultiTermQueryWrapper(field:/e.?f/))", sq.toString());
}
use of de.ids_mannheim.korap.query.QueryBuilder in project Krill by KorAP.
the class TestKrillQuery method korapQuerySegment.
// TODO: Better rename this to Builder
@Test
public void korapQuerySegment() throws QueryException {
SpanQuery sq = new QueryBuilder("field1").seg("a").with("b").toQuery();
assertEquals("spanSegment(field1:a, field1:b)", sq.toString());
sq = new QueryBuilder("field2").seg("a", "b").with("c").toQuery();
assertEquals("spanSegment(spanSegment(field2:a, field2:b), field2:c)", sq.toString());
}
Aggregations