| Nils Diewald | 92729ce | 2014-10-06 16:00:17 +0000 | [diff] [blame] | 1 | package de.ids_mannheim.korap.query.wrap; |
| 2 | |
| 3 | import 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 | */ |
| 13 | public 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 | }; |