use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestKrillQueryJSON method queryJSONcosmas20.
@Test
public void queryJSONcosmas20() throws QueryException {
SpanQueryWrapper sqwi = jsonQuery(getClass().getResource("/queries/cosmas20.json").getFile());
// "MORPH(V) #IN(R) #ELEM(S)"
assertEquals(sqwi.toQuery().toString(), "focus(1: spanEndsWith(<tokens:s />, {1: tokens:p:V}))");
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestKrillQueryJSON method queryJSONcosmasBoundaryBug.
@Test
public void queryJSONcosmasBoundaryBug() throws QueryException {
SpanQueryWrapper sqwi = jsonQuery(getClass().getResource("/queries/bugs/cosmas_boundary.jsonld").getFile());
// Namen /s1 Leben
assertEquals(sqwi.toQuery().toString(), "focus(129: spanElementDistance({129: tokens:s:Namen}, {129: tokens:s:Leben}, [(base/s:s[0:1], notOrdered, notExcluded)]))");
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestKrillQueryJSON method queryJSONDemo.
@Test
public void queryJSONDemo() throws QueryException {
SpanQueryWrapper sqwi = new KrillQuery("tokens").fromKoral("{ \"query\" : { \"@type\" : \"koral:token\", \"wrap\" : { \"@type\" : \"koral:term\", \"foundry\" : \"base\", \"layer\" : \"p\", \"key\" : \"foo\", \"match\" : \"match:eq\" }}}");
assertEquals(sqwi.toQuery().toString(), "tokens:base/p:foo");
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestKrillQueryJSON method queryJSONBsp1Disjunction.
@Test
public void queryJSONBsp1Disjunction() throws QueryException {
SpanQueryWrapper sqwi = jsonQuery(getClass().getResource("/queries/bsp1c.jsonld").getFile());
// There is a repetition in here
// ([base=foo]|[base=bar])[base=foobar]
assertEquals(sqwi.toQuery().toString(), "spanOr([tokens:base:foo, spanRepetition(spanNext(tokens:base:foo, tokens:base:bar){1,100})])");
assertTrue(sqwi.isOptional());
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestKrillQueryJSON method queryJSONBsp2.
@Test
public void queryJSONBsp2() throws QueryException {
SpanQueryWrapper sqwi = jsonQuery(getClass().getResource("/queries/bsp2.jsonld").getFile());
// ([base=foo]|[base=bar])[base=foobar]
assertEquals(sqwi.toQuery().toString(), "spanNext(spanOr([tokens:mate/l:foo, tokens:mate/l:bar]), tokens:mate/l:foobar)");
}
Aggregations