use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestKrillQueryJSON method queryJSONcosmas16.
@Test
public void queryJSONcosmas16() throws QueryException {
SpanQueryWrapper sqwi = jsonQuery(getClass().getResource("/queries/cosmas16.json").getFile());
// "$wegen #IN(L) <s>"
assertEquals(sqwi.toQuery().toString(), "focus(1: spanStartsWith(<tokens:s />, {1: tokens:i:wegen}))");
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestKrillQueryJSON method queryJSONBsp1.
@Test
public void queryJSONBsp1() throws QueryException {
SpanQueryWrapper sqwi = jsonQuery(getClass().getResource("/queries/bsp1.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 queryJSONBsp7.
@Test
public void queryJSONBsp7() throws QueryException {
SpanQueryWrapper sqwi = jsonQuery(getClass().getResource("/queries/bsp7.jsonld").getFile());
// [!base=Katze]
assertEquals("tokens:mate/l:Katze", sqwi.toQuery().toString());
assertTrue(sqwi.isNegative());
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestKrillQueryJSON method queryJSONcosmas4b.
@Test
public void queryJSONcosmas4b() throws QueryException {
SpanQueryWrapper sqwi = jsonQuery(getClass().getResource("/queries/cosmas4b.json").getFile());
// "das /+w1:3,s1 Buch"
assertEquals(sqwi.toQuery().toString(), "spanMultipleDistance(tokens:s:das, tokens:s:Buch, [(w[1:3], ordered, notExcluded), (base/s:s[0:1], ordered, notExcluded)])");
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestKrillQueryJSON method queryJSONcosmas17.
@Test
public void queryJSONcosmas17() throws QueryException {
SpanQueryWrapper sqwi = jsonQuery(getClass().getResource("/queries/cosmas17.json").getFile());
// "#BED($wegen , +sa)"
assertEquals(sqwi.toQuery().toString(), "spanStartsWith(<tokens:s />, tokens:i:wegen)");
}
Aggregations