blob: 30fe7b926b291717fde171d62c88c579e2d00401 [file] [log] [blame]
Nils Diewald92729ce2014-10-06 16:00:17 +00001package de.ids_mannheim.korap.query.wrap;
2
3import org.apache.lucene.search.spans.SpanQuery;
4
5// TODO: Add warning and error
6
7/**
8 * A wrapper class for Lucene Spanqueries that add certain information
9 * to the queries, necessary for correct deserialization of nested queries.
10 *
11 * @author Nils Diewald
12 */
13public class SpanQueryWrapper {
14 protected boolean isNull = true,
15 isOptional = false,
16 isNegative = false;
17 protected int min = 1,
18 max = 1;
19
20 // Serialize query to Lucene SpanQuery
21 public SpanQuery toQuery () {
22 return (SpanQuery) null;
23 };
24
25 // The subquery is not necessary, like in
26 // "the [pos=ADJ]? tree"
27 // The adjective can be there, but it's not necessary
28 public boolean isOptional () {
29 return this.isOptional;
30 };
31
32 // The subquery won't match anything at all,
33 // like in
34 // "the [pos=ADJ]{0} tree"
35 public boolean isNull () {
36 return this.isNull;
37 };
38
39 // The subquery should match if the condition does not hold true like in
40 // "the [base!=tree]"
41 public boolean isNegative () {
42 return this.isNegative;
43 };
44
45 // Repetition queries may be more specific regarding repetition
46 // This is a minimum repetition value
47 public int min () {
48 return this.min;
49 };
50
51 // Repetition queries may be more specific regarding repetition
52 // This is a maximum repetition value
53 public int max () {
54 return this.max;
55 };
56};