Search in sources :

Example 1 with SimpleSpanQuery

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

the class SpanWithAttributeQueryWrapper method createSpanWithAttributeListQuery.

private SpanWithAttributeQuery createSpanWithAttributeListQuery(SimpleSpanQuery withIdQuery) throws QueryException {
    List<SpanQuery> attrQueries = new ArrayList<SpanQuery>();
    SpanQuery attrQuery = null;
    for (SpanQueryWrapper sqw : queryWrapperList) {
        attrQuery = createSpanAttributeQuery(sqw);
        if (attrQuery == null) {
            isNull = true;
            return null;
        }
        attrQueries.add(attrQuery);
    }
    if (withIdQuery != null) {
        return new SpanWithAttributeQuery(withIdQuery, attrQueries, true);
    } else {
        return new SpanWithAttributeQuery(attrQueries, true);
    }
}
Also used : ArrayList(java.util.ArrayList) SpanWithAttributeQuery(de.ids_mannheim.korap.query.SpanWithAttributeQuery) SimpleSpanQuery(de.ids_mannheim.korap.query.SimpleSpanQuery) SpanQuery(org.apache.lucene.search.spans.SpanQuery)

Aggregations

SimpleSpanQuery (de.ids_mannheim.korap.query.SimpleSpanQuery)1 SpanWithAttributeQuery (de.ids_mannheim.korap.query.SpanWithAttributeQuery)1 ArrayList (java.util.ArrayList)1 SpanQuery (org.apache.lucene.search.spans.SpanQuery)1