Changeset 6935 for FCSSimpleEndpoint
- Timestamp:
- 02/03/16 23:24:10 (8 years ago)
- Location:
- FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs
- Files:
-
- 32 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/AdvancedDataViewWriter.java
r6884 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs; 2 18 … … 11 27 12 28 29 /** 30 * Helper class for serializing Advanced data views. It can be used for writing 31 * more than one, but it is <em>not thread-save</em>. 32 */ 13 33 public class AdvancedDataViewWriter { 14 34 public enum Unit { 15 ITEM, 16 TIMESTAMP 35 ITEM, TIMESTAMP 17 36 } 18 37 private static final long INITIAL_SEGMENT_ID = 1; … … 27 46 28 47 48 /** 49 * Constructor. 50 * 51 * @param unit 52 * the unit to be used for span offsets 53 * @see Unit 54 */ 29 55 public AdvancedDataViewWriter(Unit unit) { 30 56 if (unit == null) { … … 35 61 36 62 63 /** 64 * Reset the writer for writing a new data view (instance). 65 */ 37 66 public void reset() { 38 67 nextSegmentId = INITIAL_SEGMENT_ID; … … 40 69 41 70 42 private static final class Segment { 43 private final String id; 44 private final long start; 45 private final long end; 46 private final URI ref; 47 48 private Segment(long id, long start, long end) { 49 this.id = "s" + Long.toHexString(id); 50 this.start = start; 51 this.end = end; 52 this.ref = null; 53 } 54 } 55 56 private static final class Span { 57 private final Segment segment; 58 private final String value; 59 private final String altValue; 60 private final String highlight; 61 62 63 private Span(Segment segment, String value, String altValue, 64 int highlight) { 65 this.segment = segment; 66 this.value = value; 67 this.altValue = altValue; 68 if (highlight != NO_HIGHLIGHT) { 69 this.highlight = "h" + Integer.toHexString(highlight); 70 } else { 71 this.highlight = null; 72 } 73 } 74 } 75 76 71 /** 72 * Add a span. 73 * 74 * @param layerId 75 * the span's layer id 76 * @param start 77 * the span's start offset 78 * @param end 79 * the span's end offset 80 * @param value 81 * the span's content value or <code>null</code> if none 82 * @throws IllegalArgumentException 83 * if any argument is invalid 84 */ 77 85 public void addSpan(URI layerId, long start, long end, String value) { 78 86 addSpan(layerId, start, end, value, null, NO_HIGHLIGHT); … … 80 88 81 89 90 /** 91 * Add a span. 92 * 93 * @param layerId 94 * the span's layer id 95 * @param start 96 * the span's start offset 97 * @param end 98 * the span's end offset 99 * @param value 100 * the span's content value or <code>null</code> if none 101 * @param highlight 102 * the highlight group 103 * @throws IllegalArgumentException 104 * if any argument is invalid 105 */ 82 106 public void addSpan(URI layerId, long start, long end, String value, 83 107 int highlight) { … … 86 110 87 111 112 /** 113 * Add a span. 114 * 115 * @param layerId 116 * the span's layer id 117 * @param start 118 * the span's start offset 119 * @param end 120 * the span's end offset 121 * @param value 122 * the span's content value or <code>null</code> if none 123 * @param altValue 124 * the span's alternate value or <code>null</code> if none 125 */ 88 126 public void addSpan(URI layerId, long start, long end, String value, 89 127 String altValue) { … … 92 130 93 131 132 /** 133 * Add a span. 134 * 135 * @param layerId 136 * the span's layer id 137 * @param start 138 * the span's start offset 139 * @param end 140 * the span's end offset 141 * @param value 142 * the span's content value or <code>null</code> if none 143 * @param altValue 144 * @param highlight 145 * the span's alternate value or <code>null</code> if none 146 * @param highlight 147 * the highlight group 148 * @throws IllegalArgumentException 149 * if any argument is invalid 150 */ 94 151 public void addSpan(URI layerId, long start, long end, String value, 95 152 String altValue, int highlight) { … … 131 188 if (segment.equals(span.segment)) { 132 189 // FIXME: better exception! 133 throw new IllegalArgumentException("segment already exists in layer"); 190 throw new IllegalArgumentException( 191 "segment already exists in layer"); 134 192 } 135 193 } … … 138 196 139 197 198 /** 199 * Write the Advanced data view to the output stream. 200 * 201 * @param writer 202 * the writer to write to 203 * @throws XMLStreamException 204 * if an error occurs 205 */ 140 206 public void writeAdvancedDataView(XMLStreamWriter writer) 141 207 throws XMLStreamException { … … 204 270 } 205 271 272 private static final class Segment { 273 private final String id; 274 private final long start; 275 private final long end; 276 private final URI ref; 277 278 279 private Segment(long id, long start, long end) { 280 this.id = "s" + Long.toHexString(id); 281 this.start = start; 282 this.end = end; 283 this.ref = null; 284 } 285 } 286 287 private static final class Span { 288 private final Segment segment; 289 private final String value; 290 private final String altValue; 291 private final String highlight; 292 293 294 private Span(Segment segment, String value, String altValue, 295 int highlight) { 296 this.segment = segment; 297 this.value = value; 298 this.altValue = altValue; 299 if (highlight != NO_HIGHLIGHT) { 300 this.highlight = "h" + Integer.toHexString(highlight); 301 } else { 302 this.highlight = null; 303 } 304 } 305 } 306 206 307 } // class AdvancedDataViewHelper -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/Constants.java
r6850 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs; 2 18 -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/DataView.java
r5670 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs; 2 18 … … 61 77 /** 62 78 * Get the identifier of this data view. 63 * 79 * 64 80 * @return the identifier of the data view 65 81 */ … … 71 87 /** 72 88 * Get the MIME type of this data view. 73 * 89 * 74 90 * @return the MIME type of this data view 75 91 */ … … 81 97 /** 82 98 * Get the delivery policy for this data view. 83 * 99 * 84 100 * @return the delivery policy of this data view 85 101 * @see DeliveryPolicy -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/EndpointDescription.java
r6830 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs; 2 18 … … 65 81 * The implementation of this method <em>must</em> be thread-safe. 66 82 * </p> 67 * 83 * 68 84 * @return the list of layers supported in Advanced Search by this endpoint 69 85 */ -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/FCSQueryParser.java
r6882 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs; 2 18 -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/Layer.java
r6838 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs; 2 18 -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/ResourceInfo.java
r6830 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs; 2 18 -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/SimpleEndpointSearchEngineBase.java
r6849 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs; 2 18 -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/XMLStreamWriterHelper.java
r5670 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs; 2 18 -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/Constants.java
r6882 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs.parser; 2 18 19 20 /** 21 * FCS-QL expression tree constants. 22 */ 3 23 public final class Constants { 24 /** 25 * Atom occurrence it not bound. 26 */ 4 27 public static final int OCCURS_UNBOUNDED = -1; 5 28 -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/Expression.java
r6882 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs.parser; 2 18 … … 5 21 6 22 23 /** 24 * A FCS-QL expression tree SIMPLE expression node. 25 */ 7 26 public class Expression extends QueryNode { 8 27 private final String qualifier; … … 13 32 14 33 34 /** 35 * Constructor. 36 * 37 * @param qualifier 38 * the layer identifier qualifier or <code>null</code> if none 39 * @param identifier 40 * the layer identifier 41 * @param operator 42 * the operator 43 * @param regex 44 * the regular expression 45 * @param regex_flags 46 * the regular expression flags or <code>null</code> of none 47 */ 15 48 Expression(String qualifier, String identifier, Operator operator, 16 49 String regex, Set<RegexFlag> regex_flags) { … … 32 65 33 66 67 /** 68 * Get the layer identifier. 69 * 70 * @return the layer identifier 71 */ 34 72 public String getLayerIdentifier() { 35 73 return identifier; 36 74 } 37 75 38 76 77 /** 78 * Get the layer identifier qualifier. 79 * 80 * @return the layer identifier qualifier or <code>null</code> if none 81 */ 39 82 public String getLayerQualifier() { 40 83 return qualifier; … … 42 85 43 86 87 /** 88 * Get the operator. 89 * 90 * @return the operator 91 */ 44 92 public Operator getOperator() { 45 93 return operator; … … 47 95 48 96 97 /** 98 * Get the regex value. 99 * 100 * @return the regex value 101 */ 49 102 public String getRegexValue() { 50 103 return regex; … … 52 105 53 106 107 /** 108 * Get the regex flags set. 109 * 110 * @return the regex flags set or <code>null</code> if none 111 */ 54 112 public Set<RegexFlag> getRegexFlags() { 55 113 return regex_flags; … … 97 155 } 98 156 99 } 157 } // class Expression -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/ExpressionAnd.java
r6882 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs.parser; 2 18 … … 4 20 5 21 22 /** 23 * A FCS-QL expression tree AND expression node. 24 */ 6 25 public class ExpressionAnd extends QueryNode { 7 26 27 /** 28 * Constructor. 29 * 30 * @param children child elements covered by AND expression. 31 */ 8 32 ExpressionAnd(List<QueryNode> children) { 9 33 super(QueryNodeType.EXPRESSION_AND, children); … … 21 45 } 22 46 23 } 47 } // class ExpressionAnd -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/ExpressionGroup.java
r6882 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs.parser; 2 18 19 20 /** 21 * A FCS-QL expression tree GROUP expression node. 22 */ 3 23 public class ExpressionGroup extends QueryNode { 4 24 25 /** 26 * Constructor. 27 * 28 * @param content 29 * the group content 30 */ 5 31 ExpressionGroup(QueryNode content) { 6 32 super(QueryNodeType.EXPRESSION_GROUP, content); … … 29 55 } 30 56 31 } 57 } // class ExpressionGroup -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/ExpressionNot.java
r6882 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs.parser; 2 18 3 19 20 /** 21 * A FCS-QL expression tree NOT expression node. 22 */ 4 23 public class ExpressionNot extends QueryNode { 5 24 25 /** 26 * Constructor. 27 * 28 * @param child 29 * the child expression 30 */ 6 31 ExpressionNot(QueryNode child) { 7 32 super(QueryNodeType.EXPRESSION_NOT, child); … … 19 44 } 20 45 21 46 22 47 @Override 23 48 public void accept(QueryVisitor visitor) { … … 26 51 } 27 52 28 } 53 } // class ExpressionNot -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/ExpressionOr.java
r6882 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs.parser; 2 18 … … 4 20 5 21 22 /** 23 * A FCS-QL expression tree OR expression node. 24 */ 6 25 public class ExpressionOr extends QueryNode { 7 26 27 /** 28 * Constructor. 29 * 30 * @param children the children 31 */ 8 32 ExpressionOr(List<QueryNode> children) { 9 33 super(QueryNodeType.EXPRESSION_OR, children); … … 11 35 12 36 37 /** 38 * Get the OR expression operands 39 * 40 * @return a list of expressions 41 */ 13 42 public List<QueryNode> getOperands() { 14 43 return children; 15 44 } 16 45 17 46 18 47 @Override 19 48 public void accept(QueryVisitor visitor) { … … 26 55 } 27 56 28 } 57 } // class ExpressionOr -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/ExpressionWildcard.java
r6882 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs.parser; 2 18 19 20 /** 21 * A FCS-QL expression tree WILDCARD expression node. 22 */ 3 23 public class ExpressionWildcard extends QueryNode { 4 24 … … 13 33 } 14 34 15 } 35 } // class ExpressionWildcard -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/Operator.java
r6882 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs.parser; 2 18 19 20 /** 21 * FCS-QL operators. 22 */ 3 23 public enum Operator { 24 /** 25 * EQUALS operator. 26 */ 4 27 EQUALS { 5 28 @Override … … 8 31 } 9 32 }, 33 /** 34 * NOT-EQUALS operator. 35 */ 10 36 NOT_EQUALS { 11 37 @Override … … 16 42 17 43 abstract String toDisplayString(); 18 } 44 45 } // enum Operator -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/QueryDisjunction.java
r6882 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs.parser; 2 18 3 19 import java.util.List; 4 20 21 22 /** 23 * A FCS-QL expression tree QR query 24 */ 5 25 public class QueryDisjunction extends QueryNode { 6 26 /** 27 * Constructor. 28 * 29 * @param children 30 * the children 31 */ 7 32 QueryDisjunction(List<QueryNode> children) { 8 33 super(QueryNodeType.QUERY_DISJUNCTION, children); … … 20 45 } 21 46 22 } 47 } // class QueryDisjunction -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/QueryGroup.java
r6882 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs.parser; 2 18 19 20 /** 21 * A FCS-QL expression tree GROUP query node. 22 */ 3 23 public class QueryGroup extends QueryNode { 4 private int minOccurs;5 private int maxOccurs;24 private final int minOccurs; 25 private final int maxOccurs; 6 26 7 27 28 /** 29 * Constructor. 30 * 31 * @param content 32 * the child 33 * @param minOccurs 34 * the minimum occurrence 35 * @param maxOccurs 36 * the maximum occurrence 37 */ 8 38 QueryGroup(QueryNode content, int minOccurs, int maxOccurs) { 9 39 super(QueryNodeType.QUERY_GROUP, content); … … 13 43 14 44 45 /** 46 * Get the group content. 47 * 48 * @return the content of the GROUP query 49 */ 15 50 public QueryNode getContent() { 16 51 return children.get(0); … … 18 53 19 54 55 /** 56 * Get the minimum occurrence of group content. 57 * 58 * @return the minimum occurrence 59 * 60 */ 20 61 public int getMinOccurs() { 21 62 return minOccurs; … … 23 64 24 65 66 /** 67 * Get the maximum occurrence of group content. 68 * 69 * @return the maximum occurrence 70 * 71 */ 25 72 public int getMaxOccurs() { 26 73 return maxOccurs; … … 69 116 } 70 117 71 } 118 } // class QueryGroup -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/QueryNode.java
r6882 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs.parser; 2 18 … … 4 20 import java.util.List; 5 21 22 23 /** 24 * base class for FCS-QL expression tree nodes. 25 * 26 */ 6 27 public abstract class QueryNode { 7 28 protected final QueryNodeType nodeType; … … 10 31 11 32 33 /** 34 * Constructor. 35 * 36 * @param nodeType 37 * the type of the node 38 * @param children 39 * the children of this node or <code>null</code> if none 40 */ 12 41 protected QueryNode(QueryNodeType nodeType, List<QueryNode> children) { 13 42 this.nodeType = nodeType; … … 23 52 24 53 54 /** 55 * Constructor. 56 * 57 * @param nodeType 58 * the type of the node 59 * @param child 60 * the child of this node or <code>null</code> if none 61 */ 25 62 protected QueryNode(QueryNodeType nodeType, QueryNode child) { 26 63 this.nodeType = nodeType; … … 34 71 35 72 73 /** 74 * Constructor. 75 * 76 * @param nodeType 77 * the type of the node 78 */ 36 79 protected QueryNode(QueryNodeType nodeType) { 37 80 this.nodeType = nodeType; … … 40 83 41 84 85 /** 86 * Get the node type of this node. 87 * 88 * @return the node type 89 */ 42 90 public QueryNodeType getNodeType() { 43 91 return nodeType; … … 45 93 46 94 95 /** 96 * Get the parent node of this node. 97 * 98 * @return the parent node or <code>null</code> if this is the root node 99 */ 47 100 public QueryNode getParent() { 48 101 return parent; … … 50 103 51 104 105 /** 106 * The children of this node. 107 * 108 * @return the list of children of this node 109 */ 52 110 public List<QueryNode> getChildren() { 53 111 return children; … … 55 113 56 114 115 /** 116 * Get the number of children of this node. 117 * 118 * @return the number of children of this node 119 */ 57 120 public int getChildCount() { 58 121 final List<QueryNode> children = getChildren(); … … 61 124 62 125 126 /** 127 * Get a child node by index. 128 * 129 * @param idx 130 * the index of the child node 131 * @return the child node of this node or <code>null</code> if index is out 132 * of bounds 133 */ 63 134 public QueryNode getChild(int idx) { 64 135 final List<QueryNode> children = getChildren(); … … 72 143 73 144 145 /** 146 * Get this first child node. 147 * 148 * @return the first child node of this node or <code>null</code> if none 149 */ 74 150 public QueryNode getFirstChild() { 75 151 return getChild(0); … … 77 153 78 154 155 /** 156 * Get this last child node. 157 * 158 * @return the last child node of this node or <code>null</code> if none 159 */ 79 160 public QueryNode getLastChild() { 80 161 return getChild(getChildCount() - 1); … … 82 163 83 164 165 /** 166 * Get a child node of specified type by index. Only child nodes of the 167 * requested type are counted. 168 * 169 * @param clazz 170 * the type to nodes to be considered 171 * @param idx 172 * the index of the child node 173 * @return the child node of this node or <code>null</code> if no child was 174 * found 175 */ 84 176 public <T extends QueryNode> T getChild(Class<T> clazz, int idx) { 85 177 final List<QueryNode> children = getChildren(); … … 99 191 100 192 193 /** 194 * Get a first child node of specified type. 195 * 196 * @return the child node of this node or <code>null</code> if no child was 197 * found 198 */ 101 199 public <T extends QueryNode> T getFirstChild(Class<T> clazz) { 102 200 return getChild(clazz, 0); … … 155 253 } 156 254 157 } 255 } // abstract class QueryNode -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/QueryNodeType.java
r6882 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs.parser; 2 18 19 20 /** 21 * Node types of FCS-QL expression tree nodes. 22 */ 3 23 public enum QueryNodeType { 24 /** 25 * segment query 26 */ 4 27 QUERY_SEGMENT { 5 28 @Override … … 8 31 } 9 32 }, 33 /** 34 * group query 35 */ 10 36 QUERY_GROUP { 11 37 @Override … … 14 40 } 15 41 }, 42 /** 43 * sequence query 44 */ 16 45 QUERY_SEQUENCE { 17 46 @Override … … 20 49 } 21 50 }, 51 /** 52 * or query 53 */ 22 54 QUERY_DISJUNCTION { 23 55 @Override … … 26 58 } 27 59 }, 60 /** 61 * query with within part 62 */ 28 63 QUERY_WITH_WITHIN { 29 64 @Override … … 32 67 } 33 68 }, 69 /** 70 * simple expression 71 */ 34 72 EXPRESSION { 35 73 @Override … … 38 76 } 39 77 }, 78 /** 79 * wildcard expression 80 */ 40 81 EXPRESSION_WILDCARD { 41 82 @Override … … 44 85 } 45 86 }, 87 /** 88 * group expression 89 */ 46 90 EXPRESSION_GROUP { 47 91 @Override … … 50 94 } 51 95 }, 96 /** 97 * or expression 98 */ 52 99 EXPRESSION_OR { 53 100 @Override … … 56 103 } 57 104 }, 105 /** 106 * and expression 107 */ 58 108 EXPRESSION_AND { 59 109 @Override … … 62 112 } 63 113 }, 114 /** 115 * not expression 116 */ 64 117 EXPRESSION_NOT { 65 118 @Override … … 68 121 } 69 122 }, 123 /** 124 * simple within part 125 */ 70 126 SIMPLE_WITHIN { 71 127 @Override … … 76 132 77 133 abstract String toDisplayString(); 78 } 134 135 } // enum QueryNodeType -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/QueryParser.java
r6882 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs.parser; 2 18 … … 47 63 48 64 65 /** 66 * A FCS-QL query parser that produces FCS-QL expression trees. 67 */ 49 68 public class QueryParser { 50 69 private static final int[] REP_ZERO_OR_MORE = … … 64 83 65 84 85 /** 86 * Constructor. 87 */ 66 88 public QueryParser() { 67 89 this(DEFAULT_IDENTIFIER); … … 69 91 70 92 93 /** 94 * Constructor. 95 * 96 * @param defaultIdentifier 97 * the default identifer to be used for simple expressions 98 */ 71 99 public QueryParser(String defaultIdentifier) { 72 100 this.defaultIdentifier = defaultIdentifier; … … 75 103 76 104 105 /** 106 * Parse query. 107 * 108 * @param query 109 * the FCS-QL query 110 * @return a FCS-QL expression tree 111 * @throws QueryParserException 112 * if an error occurred 113 */ 77 114 public QueryNode parse(String query) throws QueryParserException { 78 115 final ErrorListener errorListener = new ErrorListener(query); -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/QueryParserException.java
r6882 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs.parser; 2 18 19 20 /** 21 * Query parser exception. 22 * 23 */ 3 24 @SuppressWarnings("serial") 4 25 public class QueryParserException extends Exception { 26 /** 27 * Constrctur. 28 * 29 * @param message 30 * an error message 31 * @param cause 32 * the underlying cause for the error 33 */ 5 34 public QueryParserException(String message, Throwable cause) { 6 35 super(message, cause); … … 8 37 9 38 39 /** 40 * Constructor. 41 * 42 * @param message 43 * an error message 44 */ 10 45 public QueryParserException(String message) { 11 46 this(message, null); 12 47 } 13 48 14 } 49 } // class QueryParserException -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/QuerySegment.java
r6882 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs.parser; 2 18 19 20 /** 21 * A FCS-QL expression tree query segment node. 22 */ 3 23 public class QuerySegment extends QueryNode { 4 24 private final int minOccurs; … … 6 26 7 27 28 /** 29 * Constructor. 30 * 31 * @param expression 32 * the expression 33 * @param minOccurs 34 * the minimum occurrence 35 * @param maxOccurs 36 * the maximum occurrence 37 */ 8 38 QuerySegment(QueryNode expression, int minOccurs, int maxOccurs) { 9 39 super(QueryNodeType.QUERY_SEGMENT, expression); … … 13 43 14 44 45 /** 46 * Get the expression for this segment. 47 * 48 * @return the expression 49 */ 15 50 public QueryNode getExpression() { 16 51 return children.get(0); … … 18 53 19 54 55 /** 56 * Get the minimum occurrence of this segment. 57 * 58 * @return the minimum occurrence 59 * 60 */ 20 61 public int getMinOccurs() { 21 62 return minOccurs; … … 23 64 24 65 66 /** 67 * Get the maximum occurrence of this segment. 68 * 69 * @return the maximum occurrence 70 * 71 */ 25 72 public int getMaxOccurs() { 26 73 return maxOccurs; 27 74 } 75 28 76 29 77 @Override … … 63 111 } 64 112 65 } 113 } // class QuerySegment -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/QuerySequence.java
r6882 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs.parser; 2 18 3 19 import java.util.List; 4 20 21 22 /** 23 * A FCS-QL expression tree query sequence node. 24 */ 5 25 public class QuerySequence extends QueryNode { 6 26 27 /** 28 * Constructor. 29 * 30 * @param children 31 * the children for this node 32 */ 7 33 QuerySequence(List<QueryNode> children) { 8 34 super(QueryNodeType.QUERY_SEQUENCE, children); … … 20 46 } 21 47 22 } 48 } // class QuerySequence -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/QueryVisitor.java
r6882 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs.parser; 2 18 19 20 /** 21 * Interface implementing a Visitor pattern for FCS-QL expression trees. 22 */ 3 23 public interface QueryVisitor { 4 24 /** 25 * Visit a <em>segment</em> query node. 26 * 27 * @param querySegment 28 * the node to visit 29 */ 5 30 public void visit(QuerySegment querySegment); 6 31 7 32 33 /** 34 * Visit a <em>group</em> query node. 35 * 36 * @param queryGroup 37 * the node to visit 38 */ 8 39 public void visit(QueryGroup queryGroup); 9 40 10 41 42 /** 43 * Visit a <em>sequence</em> query node. 44 * 45 * @param querySequence 46 * the node to visit 47 */ 11 48 public void visit(QuerySequence querySequence); 12 49 13 50 51 /** 52 * Visit a <em>or</em> query node. 53 * 54 * @param queryDisjunction 55 * the node to visit 56 */ 14 57 public void visit(QueryDisjunction queryDisjunction); 15 58 16 59 60 /** 61 * Visit a <em>query</em> with within node. 62 * 63 * @param queryWithWithin 64 * the node to visit 65 */ 17 66 public void visit(QueryWithWithin queryWithWithin); 18 67 19 68 20 public void visit(Expression expressionBasic); 69 /** 70 * Visit a <em>simple</em> expression node. 71 * 72 * @param expression 73 * the node to visit 74 */ 75 public void visit(Expression expression); 21 76 22 77 78 /** 79 * Visit a <em>wildcard</em> expression node. 80 * 81 * @param expressionWildcard 82 * the node to visit 83 */ 23 84 public void visit(ExpressionWildcard expressionWildcard); 24 85 25 86 87 /** 88 * Visit a <em>group</em> expression node. 89 * 90 * @param expressionGroup 91 * the node to visit 92 */ 26 93 public void visit(ExpressionGroup expressionGroup); 27 94 28 95 96 /** 97 * Visit a <em>or</em> expression node. 98 * 99 * @param expressionOr 100 * the node to visit 101 */ 29 102 public void visit(ExpressionOr expressionOr); 30 103 31 104 105 /** 106 * Visit a <em>and</em> expression node. 107 * 108 * @param expressionAnd 109 * the node to visit 110 */ 32 111 public void visit(ExpressionAnd expressionAnd); 33 112 34 113 114 /** 115 * Visit a <em>not</em> expression node. 116 * 117 * @param expressionNot 118 * the node to visit 119 */ 35 120 public void visit(ExpressionNot expressionNot); 36 121 37 122 123 /** 124 * Visit a <em>simple within</em> node. 125 * 126 * @param simpleWithin 127 * the node to visit 128 */ 38 129 public void visit(SimpleWithin simpleWithin); 39 130 40 } 131 } // interface QueryVisitor -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/QueryVistorAdapter.java
r6934 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs.parser; 2 18 3 public class QueryVistorAdapeter implements QueryVisitor { 19 20 /** 21 * Convenience class to implement FCS-QL expression tree visitors. Default 22 * method implementations do nothing. 23 */ 24 public class QueryVistorAdapter implements QueryVisitor { 4 25 5 26 @Override … … 62 83 } 63 84 64 } 85 } // class QueryVistorAdapter -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/QueryWithWithin.java
r6882 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs.parser; 2 18 3 19 import java.util.Arrays; 4 20 21 22 /** 23 * FCS-QL expression tree QUERY-WITH-WITHIN node. 24 */ 5 25 public class QueryWithWithin extends QueryNode { 6 26 27 /** 28 * Constructor. 29 * 30 * @param query 31 * the query node 32 * @param within 33 * the within node 34 */ 7 35 QueryWithWithin(QueryNode query, QueryNode within) { 8 36 super(QueryNodeType.QUERY_WITH_WITHIN, Arrays.asList(query, within)); … … 10 38 11 39 40 /** 41 * Get the query clause. 42 * 43 * @return the query clause 44 */ 12 45 public QueryNode getQuery() { 13 46 return getChild(0); … … 15 48 16 49 50 /** 51 * Get the within clause (= search context) 52 * 53 * @return the witin clause 54 */ 17 55 public QueryNode getWithin() { 18 56 return getChild(1); … … 29 67 } 30 68 31 } 69 } // class QueryWithWithin -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/RegexFlag.java
r6882 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs.parser; 2 18 19 20 /** 21 * FCS-QL expression tree regex flags. 22 */ 3 23 public enum RegexFlag { 24 /** 25 * case insensitive. 26 */ 4 27 CASE_INSENSITVE, 28 /** 29 * case sensitive. 30 */ 5 31 CASE_SENSITVE, 32 /** 33 * match exactly (= literally). 34 */ 6 35 LITERAL_MATCHING, 36 /** 37 * ignore all diacritics 38 */ 7 39 IGNORE_DIACRITICS 8 } 40 41 } // enum RegexFlag -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/SimpleWithin.java
r6882 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs.parser; 2 18 19 20 /** 21 * A FCS-QL expression tree SIMPLE WITHIN query node. 22 */ 3 23 public class SimpleWithin extends QueryNode { 24 /** 25 * The within scope. 26 */ 4 27 public enum Scope { 28 /** 29 * sentence scope (small). 30 */ 5 31 SENTENCE { 6 32 @Override … … 10 36 11 37 }, 38 /** 39 * utterance scope (small). 40 */ 12 41 UTTERANCE { 13 42 @Override … … 17 46 18 47 }, 48 /** 49 * paragraph scope (medium). 50 */ 19 51 PARAGRAPH { 20 52 @Override … … 24 56 25 57 }, 58 /** 59 * turn scope (medium). 60 */ 26 61 TURN { 27 62 @Override … … 30 65 } 31 66 }, 67 /** 68 * text scope (large). 69 */ 32 70 TEXT { 33 71 @Override … … 36 74 } 37 75 }, 76 /** 77 * session scope (large). 78 */ 38 79 SESSION { 39 80 @Override … … 48 89 49 90 50 public SimpleWithin(Scope scope) { 91 /** 92 * Constructor. 93 * 94 * @param scope 95 * the scope 96 */ 97 SimpleWithin(Scope scope) { 51 98 super(QueryNodeType.SIMPLE_WITHIN); 52 99 this.scope = scope; … … 54 101 55 102 103 /** 104 * Get the simple within scope 105 * 106 * @return the simple within scope 107 */ 56 108 public Scope getScope() { 57 109 return scope; -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/utils/AbstractEndpointDescriptionBase.java
r6830 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs.utils; 2 18 … … 12 28 /** 13 29 * An abstract base class for implementing endpoint descriptions. It already 14 * implements the methods required for capabilities and supported data views.30 * implements the methods required for capabilities and supported data views. 15 31 * 16 32 * @see EndpointDescription -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/utils/SimpleEndpointDescription.java
r6830 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs.utils; 2 18 -
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/utils/SimpleEndpointDescriptionParser.java
r6838 r6935 1 /** 2 * This software is copyright (c) 2013-2016 by 3 * - Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 4 * This is free software. You can redistribute it 5 * and/or modify it under the terms described in 6 * the GNU General Public License v3 of which you 7 * should have received a copy. Otherwise you can download 8 * it from 9 * 10 * http://www.gnu.org/licenses/gpl-3.0.txt 11 * 12 * @copyright Institut fuer Deutsche Sprache (http://www.ids-mannheim.de) 13 * 14 * @license http://www.gnu.org/licenses/gpl-3.0.txt 15 * GNU General Public License v3 16 */ 1 17 package eu.clarin.sru.server.fcs.utils; 2 18
Note: See TracChangeset
for help on using the changeset viewer.