Search in sources :

Example 36 with SpanQueryWrapper

use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.

the class TestKrillQueryJSON method queryJSONBsp15.

@Test
public void queryJSONBsp15() throws QueryException {
    SpanQueryWrapper sqwi = jsonQuery(getClass().getResource("/queries/bsp15.jsonld").getFile());
    // [orth='vers.*ch']
    assertEquals(sqwi.toQuery().toString(), "SpanMultiTermQueryWrapper(tokens:/s:vers.*ch/)");
}
Also used : SpanQueryWrapper(de.ids_mannheim.korap.query.wrap.SpanQueryWrapper) Test(org.junit.Test)

Example 37 with SpanQueryWrapper

use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.

the class TestKrillQueryJSON method queryJSONrepetitionGroupRewriteBug.

@Test
public void queryJSONrepetitionGroupRewriteBug() throws QueryException {
    // ([cnx/p="A"][]){2}
    SpanQueryWrapper sqwi = jsonQuery(getClass().getResource("/queries/bugs/repetition_group_rewrite.jsonld").getFile());
    assertEquals(sqwi.toQuery().toString(), "spanRepetition(spanExpansion(SpanMultiTermQueryWrapper(tokens:/cnx/p:A/), []{1, 1}, right){2,2})");
}
Also used : SpanQueryWrapper(de.ids_mannheim.korap.query.wrap.SpanQueryWrapper) Test(org.junit.Test)

Example 38 with SpanQueryWrapper

use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.

the class TestKrillQueryJSON method queryJSONBsp13.

@Test
public void queryJSONBsp13() throws QueryException {
    SpanQueryWrapper sqwi = jsonQuery(getClass().getResource("/queries/bsp13.jsonld").getFile());
    assertEquals(sqwi.toQuery().toString(), "spanStartsWith(<tokens:np />, tokens:p:Det)");
}
Also used : SpanQueryWrapper(de.ids_mannheim.korap.query.wrap.SpanQueryWrapper) Test(org.junit.Test)

Example 39 with SpanQueryWrapper

use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.

the class TestKrillQueryJSON method queryJSONBsp3.

@Test
public void queryJSONBsp3() throws QueryException {
    SpanQueryWrapper sqwi = jsonQuery(getClass().getResource("/queries/bsp3.jsonld").getFile());
    // focus({[base=Mann]})
    assertEquals(sqwi.toQuery().toString(), "focus(1: {1: tokens:mate/l:Mann})");
}
Also used : SpanQueryWrapper(de.ids_mannheim.korap.query.wrap.SpanQueryWrapper) Test(org.junit.Test)

Example 40 with SpanQueryWrapper

use of de.ids_mannheim.korap.query.wrap.SpanQueryWrapper in project Krill by KorAP.

the class TestKrillQueryJSON method queryJSONcosmas10.

@Test
public void queryJSONcosmas10() throws QueryException {
    SpanQueryWrapper sqwi = jsonQuery(getClass().getResource("/queries/cosmas10.json").getFile());
    // "Institut für $deutsche Sprache"
    assertEquals(sqwi.toQuery().toString(), "spanNext(spanNext(spanNext(tokens:s:Institut, tokens:s:für), tokens:i:deutsche), tokens:s:Sprache)");
}
Also used : SpanQueryWrapper(de.ids_mannheim.korap.query.wrap.SpanQueryWrapper) Test(org.junit.Test)

Aggregations

SpanQueryWrapper (de.ids_mannheim.korap.query.wrap.SpanQueryWrapper)165 Test (org.junit.Test)150 SpanQuery (org.apache.lucene.search.spans.SpanQuery)65 KrillIndex (de.ids_mannheim.korap.KrillIndex)17 QueryException (de.ids_mannheim.korap.util.QueryException)14 KrillQuery (de.ids_mannheim.korap.KrillQuery)13 QueryBuilder (de.ids_mannheim.korap.query.QueryBuilder)11 Result (de.ids_mannheim.korap.response.Result)8 JsonNode (com.fasterxml.jackson.databind.JsonNode)7 Krill (de.ids_mannheim.korap.Krill)5 SpanRepetitionQueryWrapper (de.ids_mannheim.korap.query.wrap.SpanRepetitionQueryWrapper)3 TestSimple.getJsonString (de.ids_mannheim.korap.TestSimple.getJsonString)2 SpanClassQuery (de.ids_mannheim.korap.query.SpanClassQuery)2 SpanDistanceQuery (de.ids_mannheim.korap.query.SpanDistanceQuery)2 SpanWithinQuery (de.ids_mannheim.korap.query.SpanWithinQuery)2 SpanAlterQueryWrapper (de.ids_mannheim.korap.query.wrap.SpanAlterQueryWrapper)2 SpanRegexQueryWrapper (de.ids_mannheim.korap.query.wrap.SpanRegexQueryWrapper)2 SpanSegmentQueryWrapper (de.ids_mannheim.korap.query.wrap.SpanSegmentQueryWrapper)2 Term (org.apache.lucene.index.Term)2 SpanOrQuery (org.apache.lucene.search.spans.SpanOrQuery)2