Search in sources :

Example 61 with SpanQueryWrapper

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

the class TestSpanSequenceQueryJSON method queryJSONseqEmptyMiddle.

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

Example 62 with SpanQueryWrapper

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

the class TestSpanSequenceQueryJSON method queryJSONkoralSimpleDistanceBug.

@Test
public void queryJSONkoralSimpleDistanceBug() throws QueryException {
    SpanQueryWrapper sqwi = jsonQueryFile("distance-simple.jsonld");
    assertEquals("spanDistance(tokens:s:der, tokens:s:Baum, [(w[2:2], ordered, notExcluded)])", sqwi.toQuery().toString());
}
Also used : SpanQueryWrapper(de.ids_mannheim.korap.query.wrap.SpanQueryWrapper) Test(org.junit.Test)

Example 63 with SpanQueryWrapper

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

the class TestSpanSequenceQueryJSON method queryJSONseqNegativeEndRepetitionClass2.

@Test
public void queryJSONseqNegativeEndRepetitionClass2() throws QueryException {
    SpanQueryWrapper sqwi = jsonQueryFile("negative-last-class-repetition-2.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 64 with SpanQueryWrapper

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

the class TestSpanSequenceQueryJSON method queryJSONseqNegativeStartRepetition3.

@Test
public void queryJSONseqNegativeStartRepetition3() throws QueryException {
    SpanQueryWrapper sqwi = jsonQueryFile("negative-first-repetition-3.jsonld");
    // [tt/p!=NN]{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 65 with SpanQueryWrapper

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

the class TestSpanSequenceQueryJSON method queryJSONseqNegativeStartRepetition2.

@Test
public void queryJSONseqNegativeStartRepetition2() throws QueryException {
    SpanQueryWrapper sqwi = jsonQueryFile("negative-first-repetition-2.jsonld");
    // [tt/p!=NN]{0,5}[tt/p=NN]
    assertEquals(sqwi.toQuery().toString(), "spanExpansion(tokens:tt/p:NN, !tokens:tt/p:NN{0, 5}, left)");
}
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