use of org.apache.lucene.search.spans.SpanQuery in project Krill by KorAP.
the class TestKrillQuery method KorapShrinkQuery2.
@Test
public void KorapShrinkQuery2() throws QueryException {
QueryBuilder kq = new QueryBuilder("field");
SpanQuery sq = kq.focus(1, kq.nr(1, kq.tag("np"))).toQuery();
assertEquals("focus(1: {1: <field:np />})", sq.toString());
}
use of org.apache.lucene.search.spans.SpanQuery in project Krill by KorAP.
the class TestKrillQuery method KorapTagQuery4.
@Test
public void KorapTagQuery4() throws QueryException {
QueryBuilder kq = new QueryBuilder("field");
SpanQuery sq = kq.seq(kq.tag("np"), kq.tag("vp")).append("test").toQuery();
assertEquals("spanNext(spanNext(<field:np />, <field:vp />), field:test)", sq.toString());
}
use of org.apache.lucene.search.spans.SpanQuery in project Krill by KorAP.
the class TestKrillQuery method KorapShrinkQuery.
@Test
public void KorapShrinkQuery() throws QueryException {
QueryBuilder kq = new QueryBuilder("field");
SpanQuery sq = kq.focus(kq.tag("np")).toQuery();
assertEquals("focus(1: <field:np />)", sq.toString());
}
use of org.apache.lucene.search.spans.SpanQuery in project Krill by KorAP.
the class TestKrillQuery method KorapSequenceQuery4.
@Test
public void KorapSequenceQuery4() throws QueryException {
QueryBuilder kq = new QueryBuilder("field");
SpanQuery sq = kq.seq(kq.seg("try1")).append(kq.seg("try2")).withConstraint(2, 3, "s").withConstraint(5, 6, "w").toQuery();
assertEquals("spanMultipleDistance(field:try1, field:try2, [(s[2:3], ordered, notExcluded), (w[5:6], ordered, notExcluded)])", sq.toString());
}
use of org.apache.lucene.search.spans.SpanQuery 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());
}
Aggregations