use of de.ids_mannheim.korap.query.QueryBuilder in project Krill by KorAP.
the class TestKrillQuery method KorapTagQuery.
@Test
public void KorapTagQuery() throws QueryException {
QueryBuilder kq = new QueryBuilder("field");
SpanQuery sq = kq.tag("np").toQuery();
assertEquals("<field:np />", sq.toString());
}
use of de.ids_mannheim.korap.query.QueryBuilder in project Krill by KorAP.
the class TestKrillQuery method KorapSequenceQuery7.
@Test
public void KorapSequenceQuery7() throws QueryException {
QueryBuilder kq = new QueryBuilder("field");
SpanQuery sq = kq.seq(kq.seg("try1")).append(kq.seg("try2")).withConstraint(5, 6).withConstraint(2, 3, "s", true).toQuery();
assertEquals("spanMultipleDistance(field:try1, field:try2, [(w[5:6], ordered, notExcluded), (s[2:3], ordered, excluded)])", sq.toString());
}
use of de.ids_mannheim.korap.query.QueryBuilder in project Krill by KorAP.
the class TestKrillQuery method KorapWithinQuery3.
@Test
public void KorapWithinQuery3() throws QueryException {
QueryBuilder kq = new QueryBuilder("field");
SpanQuery sq = kq.startswith(kq.seg("test"), kq.seg("test2")).toQuery();
assertEquals("spanStartsWith(field:test, field:test2)", sq.toString());
}
use of de.ids_mannheim.korap.query.QueryBuilder in project Krill by KorAP.
the class TestKrillQuery method KorapSequenceQuery2.
@Test
public void KorapSequenceQuery2() throws QueryException {
QueryBuilder kq = new QueryBuilder("field");
SpanQuery sq = kq.seq(kq.seg("try1")).append(kq.seg("try2")).withConstraint(2, 3).toQuery();
assertEquals("spanDistance(field:try1, field:try2, [(w[2:3], ordered, notExcluded)])", sq.toString());
}
use of de.ids_mannheim.korap.query.QueryBuilder in project Krill by KorAP.
the class TestKrillQuery method KorapSequenceQuery1.
@Test
public void KorapSequenceQuery1() throws QueryException {
QueryBuilder kq = new QueryBuilder("field");
SpanQuery sq = kq.seq(kq.seg("try1")).append(kq.seg("try2")).toQuery();
assertEquals("spanNext(field:try1, field:try2)", sq.toString());
}
Aggregations