use of de.ids_mannheim.korap.query.QueryBuilder in project Krill by KorAP.
the class TestKrillQuery method KorapTagQuery6.
@Test
public void KorapTagQuery6() throws QueryException {
QueryBuilder kq = new QueryBuilder("field");
SpanQuery sq = kq.seq(kq.seg("tree"), kq.contains(kq.tag("s"), kq.tag("np")), kq.re("hey.*")).toQuery();
assertEquals("spanNext(spanNext(field:tree, spanContain(<field:s />, <field:np />)), SpanMultiTermQueryWrapper(field:/hey.*/))", sq.toString());
}
use of de.ids_mannheim.korap.query.QueryBuilder in project Krill by KorAP.
the class TestKrillQuery method KorapShrinkQuery1.
@Test
public void KorapShrinkQuery1() throws QueryException {
QueryBuilder kq = new QueryBuilder("field");
SpanQuery sq = kq.focus(1, kq.tag("np")).toQuery();
assertEquals("focus(1: <field:np />)", sq.toString());
}
use of de.ids_mannheim.korap.query.QueryBuilder in project Krill by KorAP.
the class TestKrillQuery method KorapShrinkQuery3.
@Test
public void KorapShrinkQuery3() throws QueryException {
QueryBuilder kq = new QueryBuilder("field");
SpanQuery sq = kq.focus(1, kq.nr(1, kq.seq(kq.tag("np"), kq.nr(kq.seg("test").without("no"))))).toQuery();
assertEquals("focus(1: {1: spanNext(<field:np />, {1: spanNot(field:test, field:no, 0, 0)})})", sq.toString());
}
use of de.ids_mannheim.korap.query.QueryBuilder in project Krill by KorAP.
the class TestKrillQuery method KorapTagQuery2.
@Test
public void KorapTagQuery2() throws QueryException {
QueryBuilder kq = new QueryBuilder("field");
SpanQuery sq = kq.or(kq.tag("np"), kq.tag("vp")).toQuery();
assertEquals("spanOr([<field:np />, <field:vp />])", sq.toString());
}
use of de.ids_mannheim.korap.query.QueryBuilder in project Krill by KorAP.
the class TestKrillQuery method KorapSequenceQuery3.
@Test
public void KorapSequenceQuery3() throws QueryException {
QueryBuilder kq = new QueryBuilder("field");
SpanQuery sq = kq.seq(kq.seg("try1")).append(kq.seg("try2")).withConstraint(2, 3, "s").toQuery();
assertEquals("spanElementDistance(field:try1, field:try2, [(s[2:3], ordered, notExcluded)])", sq.toString());
}
Aggregations