Search in sources :

Example 66 with SpanQueryWrapper

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

the class TestSpanSequenceQueryJSON method queryJSONseqEmptyMiddleClass.

@Test
public void queryJSONseqEmptyMiddleClass() throws QueryException {
    SpanQueryWrapper sqwi = jsonQueryFile("empty-middle-class.jsonld");
    // der{1:[]}[tt/p=NN]
    assertEquals(sqwi.toQuery().toString(), "spanNext(tokens:s:der, spanExpansion(tokens:tt/p:NN, []{1, 1}, left, class:1))");
}
Also used : SpanQueryWrapper(de.ids_mannheim.korap.query.wrap.SpanQueryWrapper) Test(org.junit.Test)

Example 67 with SpanQueryWrapper

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

the class TestSpanSequenceQueryJSON method queryJSONseqNegativeStartRepetition.

@Test
public void queryJSONseqNegativeStartRepetition() throws QueryException {
    SpanQueryWrapper sqwi = jsonQueryFile("negative-first-repetition.jsonld");
    // [tt/p!=NN]{4,5}[tt/p=NN]
    assertEquals(sqwi.toQuery().toString(), "spanExpansion(tokens:tt/p:NN, !tokens:tt/p:NN{4, 5}, left)");
}
Also used : SpanQueryWrapper(de.ids_mannheim.korap.query.wrap.SpanQueryWrapper) Test(org.junit.Test)

Example 68 with SpanQueryWrapper

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

the class TestSpanSequenceQueryJSON method queryJSONseqEmptyStartRepetition2.

@Test
public void queryJSONseqEmptyStartRepetition2() throws QueryException {
    SpanQueryWrapper sqwi = jsonQueryFile("empty-first-repetition-2.jsonld");
    // []{0,0}[tt/p=NN]
    assertEquals(sqwi.toQuery().toString(), "tokens:tt/p:NN");
}
Also used : SpanQueryWrapper(de.ids_mannheim.korap.query.wrap.SpanQueryWrapper) Test(org.junit.Test)

Example 69 with SpanQueryWrapper

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

the class TestSpanSequenceQueryJSON method queryJSONseqNegativeEndRepetitionClass.

@Test
public void queryJSONseqNegativeEndRepetitionClass() throws QueryException {
    SpanQueryWrapper sqwi = jsonQueryFile("negative-last-class-repetition.jsonld");
    // [tt/p=NN]{2:[tt/p!=NN]{4,5}}
    assertEquals(sqwi.toQuery().toString(), "focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(tokens:tt/p:NN, !tokens:tt/p:NN{4, 5}, right, class:2)}))");
}
Also used : SpanQueryWrapper(de.ids_mannheim.korap.query.wrap.SpanQueryWrapper) Test(org.junit.Test)

Example 70 with SpanQueryWrapper

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

the class TestSpanSequenceQueryJSON method queryJSONseqEmptyEndClass.

@Test
public void queryJSONseqEmptyEndClass() throws QueryException {
    SpanQueryWrapper sqwi = jsonQueryFile("empty-last-class.jsonld");
    // der{3:[]}
    assertEquals(sqwi.toQuery().toString(), "focus(254: spanContain(<tokens:base/s:t />, {254: spanExpansion(tokens:s:der, []{1, 1}, right, class:3)}))");
}
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