<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 -->
<conceptSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://incubator.apache.org/uima/regex">
	
    <concept name="filterFeatures1">
    	<rules>
			<rule regEx="SimpleRegex" matchStrategy="matchAll" matchType="uima.tcas.DocumentAnnotation">
				<matchTypeFilter>
					<feature featurePath="language">en</feature>
				</matchTypeFilter>
			</rule>
	    </rules>
	    <createAnnotations>	
			<annotation id="testannot" type="org.apache.uima.TestAnnot">
				<begin group="0"/>
				<end group="0"/>
		 	</annotation>
	 	</createAnnotations>
    </concept>

    <concept name="filterFeatures2">
    	<rules>
			<rule regEx="AdvancedFilterRegex" matchStrategy="matchAll" matchType="uima.tcas.DocumentAnnotation">
				<matchTypeFilter>
					<feature featurePath="language">en-\w\w</feature>
				</matchTypeFilter>
			</rule>
	    </rules>
	    <createAnnotations>	
			<annotation id="testannot1" type="org.apache.uima.TestAnnot">
				<begin group="0"/>
				<end group="0"/>
		 	</annotation>
	 	</createAnnotations>
    </concept>

<!-- create an annotation to check another filter condition -->
    <concept name="CreateAnnot">
    	<rules>
			<rule regEx="(JustCreate)(AnAnnotation)" matchStrategy="matchAll" matchType="uima.tcas.DocumentAnnotation"/>
	    </rules>
	    <createAnnotations>	
			<annotation id="testannot3" type="org.apache.uima.TestAnnot">
				<begin group="0"/>
				<end group="0"/>
				<setFeature name="testFeature" type="String">$1</setFeature>
				<setFeature name="testFeature1" type="String">$2</setFeature>
				<!-- create a reference to another annotation to validate a feature path later -->
				<setFeature name="refFeature" type="Reference">testannot6</setFeature>
		 	</annotation>
		 	<annotation id="testannot6" type="org.apache.uima.TestAnnot2">
				<begin group="0"/>
				<end group="0"/>
				<setFeature name="testFeature" type="String">$1</setFeature>
				<setFeature name="testFeature1" type="String">$2</setFeature>
		 	</annotation>
		 	
	 	</createAnnotations>
    </concept>

    <concept name="checkAnotherFilter">
    	<rules>
			<rule regEx="Annotation" matchStrategy="matchAll" matchType="org.apache.uima.TestAnnot">
				<matchTypeFilter>
					<feature featurePath="testFeature">JustCreate</feature>
					<feature featurePath="testFeature1">AnAnnotation</feature>
					<!-- validate a featurePath for a filter feature -->
					<feature featurePath="refFeature/testFeature">JustCreate</feature>
					<feature featurePath="refFeature/testFeature1">AnAnnotation</feature>
				</matchTypeFilter>
			</rule>
	    </rules>
	    <createAnnotations>	
			<annotation id="testannot4" type="org.apache.uima.TestAnnot">
				<begin group="0"/>
				<end group="0"/>
				<setFeature name="testFeature" type="String">$0</setFeature>
		 	</annotation>
	 	</createAnnotations>
    </concept>

    <concept name="checkAnotherFilterThatDoesNotMatch">
    	<rules>
			<rule regEx="Annotation" matchStrategy="matchAll" matchType="org.apache.uima.TestAnnot">
				<matchTypeFilter>
					<feature featurePath="testFeature">doesNotMatch</feature>
					<feature featurePath="testFeature1">AnAnnotation</feature>
				</matchTypeFilter>
			</rule>
	    </rules>
	    <createAnnotations>	
			<annotation id="testannot5" type="org.apache.uima.TestAnnot">
				<begin group="0"/>
				<end group="0"/>
		 	</annotation>
	 	</createAnnotations>
    </concept>

</conceptSet>
