use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestKrillQueryJSON method queryJSONBsp11.
@Test
public void queryJSONBsp11() throws QueryException {
SpanQueryWrapper sqwi = jsonQuery(getClass().getResource("/queries/bsp11.jsonld").getFile());
// [base!=Katze | orth!=Katzen]
/*
Imagine a([^b]|[^c])d
Matches abd and acd
Interpretation would be not(spanAnd(...))
*/
assertEquals(sqwi.toQuery().toString(), "spanOr([tokens:mate/l:Katze, tokens:s:Katzen])");
assertTrue(sqwi.isNegative());
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestKrillQueryJSON method queryJSONBsp6.
@Test
public void queryJSONBsp6() throws QueryException {
SpanQueryWrapper sqwi = jsonQuery(getClass().getResource("/queries/bsp6.jsonld").getFile());
// [base=katze]
assertEquals(sqwi.toQuery().toString(), "tokens:mate/l:Katze");
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestKrillQueryJSON method queryJSONspecialLayerBug.
@Test
public void queryJSONspecialLayerBug() throws QueryException {
SpanQueryWrapper sqwi = jsonQuery(getClass().getResource("/queries/bugs/special_layer.jsonld").getFile());
assertEquals(sqwi.toQuery().toString(), "spanNext(spanNext(spanNext(tokens:s:Baum, tokens:cnx/p:CC), tokens:tt/l:Baum), <tokens:xip/c:MC />)");
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestKrillQueryJSON method queryJSONflags1.
@Test
public void queryJSONflags1() throws QueryException {
// buchstabe/i
SpanQueryWrapper sqwi = jsonQuery(getClass().getResource("/queries/flags/caseInsensitive.jsonld").getFile());
assertEquals(sqwi.toQuery().toString(), "tokens:i:buchstabe");
}
use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.
the class TestKrillQueryJSON method queryJSONrepetition.
@Test
public void queryJSONrepetition() throws QueryException {
SpanQueryWrapper sqwi = jsonQuery(getClass().getResource("/queries/bsp-repetition.jsonld").getFile());
// der[cnx/p=A]{0,2}[tt/p=NN]
assertEquals(sqwi.toQuery().toString(), "spanNext(tokens:s:der, spanOr([tokens:tt/p:NN, spanNext(spanRepetition(tokens:cnx/p:A{1,2}), tokens:tt/p:NN)]))");
}
Aggregations