You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by mb...@apache.org on 2007/10/08 18:30:41 UTC
svn commit: r582868 [2/2] - in
/incubator/uima/sandbox/trunk/RegularExpressionAnnotator: desc/ lib/
src/main/java/org/apache/uima/annotator/regex/
src/main/java/org/apache/uima/annotator/regex/impl/
src/main/resources/org/apache/uima/annotator/regex/ s...
Modified: incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/main/java/org/apache/uima/annotator/regex/impl/Rule_impl.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/main/java/org/apache/uima/annotator/regex/impl/Rule_impl.java?rev=582868&r1=582867&r2=582868&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/main/java/org/apache/uima/annotator/regex/impl/Rule_impl.java (original)
+++ incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/main/java/org/apache/uima/annotator/regex/impl/Rule_impl.java Mon Oct 8 09:30:38 2007
@@ -21,10 +21,10 @@
import java.util.ArrayList;
import java.util.regex.Pattern;
-import org.apache.uima.annotator.regex.RuleException;
import org.apache.uima.annotator.regex.Feature;
import org.apache.uima.annotator.regex.FilterFeature;
import org.apache.uima.annotator.regex.Rule;
+import org.apache.uima.annotator.regex.RuleException;
import org.apache.uima.cas.Type;
import org.apache.uima.cas.TypeSystem;
import org.apache.uima.resource.ResourceInitializationException;
@@ -34,202 +34,241 @@
*/
public class Rule_impl implements Rule {
- private final String regex;
-
- private final String id;
-
- private final float confidence;
-
- private final String matchTypeStr;
-
- private final int matchStrategy;
-
- private Pattern pattern;
-
- private Type matchType;
-
- private ArrayList filterFeatures;
-
- private ArrayList updateFeatures;
-
- private ArrayList exceptions;
-
-
- public Rule_impl(String regex, int matchStrategy, String matchType, String id, float confidence) {
- this.regex = regex;
- this.matchStrategy = matchStrategy;
- this.matchTypeStr = matchType;
- this.filterFeatures = new ArrayList();
- this.updateFeatures = new ArrayList();
- this.exceptions = new ArrayList();
- this.pattern = null;
- this.id = id;
- this.confidence = confidence;
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.annotator.regex.Rule#addFilterFeature(org.apache.uima.annotator.regex.Feature)
- */
- public void addFilterFeature(FilterFeature aFeature) {
- this.filterFeatures.add(aFeature);
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.annotator.regex.Rule#getMatchTypeFilterFeatures()
- */
- public FilterFeature[] getMatchTypeFilterFeatures() {
- return (FilterFeature[]) this.filterFeatures.toArray(new FilterFeature[0]);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.uima.annotator.regex.Rule#getMatchStrategy()
- */
- public int getMatchStrategy() {
- return this.matchStrategy;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.uima.annotator.regex.Rule#getMatchType()
- */
- public Type getMatchType() {
- return this.matchType;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.uima.annotator.regex.Rule#getRegex()
- */
- public Pattern getRegexPattern() {
- return this.pattern;
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.annotator.regex.Rule#getConfidence()
- */
- public float getConfidence() {
- return this.confidence;
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.annotator.regex.Rule#getId()
- */
- public String getId() {
- return this.id;
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.annotator.regex.Rule#addUpdateFeature(org.apache.uima.annotator.regex.Feature)
- */
- public void addUpdateFeature(Feature aFeature) {
- this.updateFeatures.add(aFeature);
-
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.annotator.regex.Rule#getMatchTypeUpdateFeatures()
- */
- public Feature[] getMatchTypeUpdateFeatures() {
- return (Feature[]) this.updateFeatures.toArray(new Feature[0]);
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.annotator.regex.Rule#addException(org.apache.uima.annotator.regex.Exception)
- */
- public void addException(RuleException aException) {
- this.exceptions.add(aException);
-
- }
-
- /* (non-Javadoc)
- * @see org.apache.uima.annotator.regex.Rule#getExceptions()
- */
- public RuleException[] getExceptions() {
- return (RuleException[]) this.exceptions.toArray(new RuleException[0]);
- }
-
- /**
- * @param ts
- * @throws ResourceInitializationException
- */
- public void initialize(TypeSystem ts) throws ResourceInitializationException {
-
- // compile regex
- this.pattern = Pattern.compile(this.regex);
-
- // initialize the match type
- if (this.matchTypeStr != null) {
- this.matchType = ts.getType(this.matchTypeStr);
- if (this.matchType == null) {
- throw new ResourceInitializationException(RegExAnnotator.MESSAGE_DIGEST,
- "regex_annotator_error_resolving_types", new Object[] { this.matchTypeStr });
- }
- }
-
- //initialize match type filters
- FilterFeature[] filterFeats = getMatchTypeFilterFeatures();
- for (int i = 0; i < filterFeats.length; i++) {
- ((FilterFeature_impl)filterFeats[i]).initialize(this.matchType);
- }
-
- //initialize match type update features
- Feature[] updateFeats = getMatchTypeUpdateFeatures();
- for (int i = 0; i < updateFeats.length; i++) {
- ((Feature_impl)updateFeats[i]).initialize(this.matchType);
- }
-
- //initialize rule exceptions
- RuleException[] ruleExceptions = getExceptions();
- for (int i = 0; i < ruleExceptions.length; i++) {
- ((RuleException_impl)ruleExceptions[i]).initialize(ts);
- }
-
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
- public String toString() {
-
- StringBuffer buffer = new StringBuffer();
- buffer.append("Rule ");
- if(this.id != null) {
- buffer.append(this.id);
- }
- buffer.append("\n");
- buffer.append("Regex: ");
- buffer.append(this.regex);
- if (this.matchStrategy == Rule.MATCH_ALL) {
- buffer.append("\nMatch strategy: MATCH_ALL");
- } else if (this.matchStrategy == Rule.MATCH_COMPLETE) {
- buffer.append("\nMatch strategy: MATCH_COMPLETE");
- } else if (this.matchStrategy == Rule.MATCH_FIRST) {
- buffer.append("\nMatch strategy: MATCH_FIRST");
- }
- buffer.append("\nMatch type: ");
- buffer.append(this.matchTypeStr);
-
- if(this.confidence != 0.0) {
- buffer.append("\nConfidence: ");
- buffer.append(this.confidence);
- }
-
- FilterFeature[] filterFeats = getMatchTypeFilterFeatures();
- if(filterFeats.length > 0) {
- buffer.append("\nMatch type filter features: \n");
- }
- for (int i = 0; i < filterFeats.length; i++) {
- buffer.append(filterFeats[i].toString());
- }
- buffer.append("\n");
- return buffer.toString();
- }
+ private final String regex;
+
+ private final String id;
+
+ private final float confidence;
+
+ private final String matchTypeStr;
+
+ private final int matchStrategy;
+
+ private Pattern pattern;
+
+ private Type matchType;
+
+ private ArrayList filterFeatures;
+
+ private ArrayList updateFeatures;
+
+ private ArrayList exceptions;
+
+ public Rule_impl(String regex, int matchStrategy, String matchType,
+ String id, float confidence) {
+ this.regex = regex;
+ this.matchStrategy = matchStrategy;
+ this.matchTypeStr = matchType;
+ this.filterFeatures = new ArrayList();
+ this.updateFeatures = new ArrayList();
+ this.exceptions = new ArrayList();
+ this.pattern = null;
+ this.id = id;
+ this.confidence = confidence;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.annotator.regex.Rule#addFilterFeature(org.apache.uima.annotator.regex.Feature)
+ */
+ public void addFilterFeature(FilterFeature aFeature) {
+ this.filterFeatures.add(aFeature);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.annotator.regex.Rule#getMatchTypeFilterFeatures()
+ */
+ public FilterFeature[] getMatchTypeFilterFeatures() {
+ return (FilterFeature[]) this.filterFeatures
+ .toArray(new FilterFeature[0]);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.annotator.regex.Rule#getMatchStrategy()
+ */
+ public int getMatchStrategy() {
+ return this.matchStrategy;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.annotator.regex.Rule#getMatchType()
+ */
+ public Type getMatchType() {
+ return this.matchType;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.annotator.regex.Rule#getRegex()
+ */
+ public Pattern getRegexPattern() {
+ return this.pattern;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.annotator.regex.Rule#getConfidence()
+ */
+ public float getConfidence() {
+ return this.confidence;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.annotator.regex.Rule#getId()
+ */
+ public String getId() {
+ return this.id;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.annotator.regex.Rule#addUpdateFeature(org.apache.uima.annotator.regex.Feature)
+ */
+ public void addUpdateFeature(Feature aFeature) {
+ this.updateFeatures.add(aFeature);
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.annotator.regex.Rule#getMatchTypeUpdateFeatures()
+ */
+ public Feature[] getMatchTypeUpdateFeatures() {
+ return (Feature[]) this.updateFeatures.toArray(new Feature[0]);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.annotator.regex.Rule#addException(org.apache.uima.annotator.regex.Exception)
+ */
+ public void addException(RuleException aException) {
+ this.exceptions.add(aException);
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.annotator.regex.Rule#getExceptions()
+ */
+ public RuleException[] getExceptions() {
+ return (RuleException[]) this.exceptions.toArray(new RuleException[0]);
+ }
+
+ /**
+ * @param ts
+ * @throws ResourceInitializationException
+ */
+ public void typeInit(TypeSystem ts) throws ResourceInitializationException {
+ // initialize the match type
+ if (this.matchTypeStr != null) {
+ this.matchType = ts.getType(this.matchTypeStr);
+ if (this.matchType == null) {
+ throw new ResourceInitializationException(
+ RegExAnnotator.MESSAGE_DIGEST,
+ "regex_annotator_error_resolving_types",
+ new Object[] { this.matchTypeStr });
+ }
+ }
+
+ // initialize match type filters
+ FilterFeature[] filterFeats = getMatchTypeFilterFeatures();
+ for (int i = 0; i < filterFeats.length; i++) {
+ ((FilterFeature_impl) filterFeats[i]).typeInit(this.matchType);
+ }
+
+ // initialize match type update features
+ Feature[] updateFeats = getMatchTypeUpdateFeatures();
+ for (int i = 0; i < updateFeats.length; i++) {
+ ((Feature_impl) updateFeats[i]).typeInit(this.matchType);
+ }
+
+ // initialize rule exceptions
+ RuleException[] ruleExceptions = getExceptions();
+ for (int i = 0; i < ruleExceptions.length; i++) {
+ ((RuleException_impl) ruleExceptions[i]).typeInit(ts);
+ }
+ }
+
+ /**
+ * @throws RegexAnnotatorConfigException
+ */
+ public void initialize() throws RegexAnnotatorConfigException {
+ // compile regex
+ this.pattern = Pattern.compile(this.regex);
+
+ // initialize match type filters
+ FilterFeature[] filterFeats = getMatchTypeFilterFeatures();
+ for (int i = 0; i < filterFeats.length; i++) {
+ ((FilterFeature_impl) filterFeats[i]).initialize();
+ }
+
+ // initialize match type update features
+ Feature[] updateFeats = getMatchTypeUpdateFeatures();
+ for (int i = 0; i < updateFeats.length; i++) {
+ ((Feature_impl) updateFeats[i]).initialize();
+ }
+
+ // initialize rule exceptions
+ RuleException[] ruleExceptions = getExceptions();
+ for (int i = 0; i < ruleExceptions.length; i++) {
+ ((RuleException_impl) ruleExceptions[i]).initialize();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("Rule ");
+ if (this.id != null) {
+ buffer.append(this.id);
+ }
+ buffer.append("\n");
+ buffer.append("Regex: ");
+ buffer.append(this.regex);
+ if (this.matchStrategy == Rule.MATCH_ALL) {
+ buffer.append("\nMatch strategy: MATCH_ALL");
+ } else if (this.matchStrategy == Rule.MATCH_COMPLETE) {
+ buffer.append("\nMatch strategy: MATCH_COMPLETE");
+ } else if (this.matchStrategy == Rule.MATCH_FIRST) {
+ buffer.append("\nMatch strategy: MATCH_FIRST");
+ }
+ buffer.append("\nMatch type: ");
+ buffer.append(this.matchTypeStr);
+
+ if (this.confidence != 0.0) {
+ buffer.append("\nConfidence: ");
+ buffer.append(this.confidence);
+ }
+
+ FilterFeature[] filterFeats = getMatchTypeFilterFeatures();
+ if (filterFeats.length > 0) {
+ buffer.append("\nMatch type filter features: \n");
+ }
+ for (int i = 0; i < filterFeats.length; i++) {
+ buffer.append(filterFeats[i].toString());
+ }
+ buffer.append("\n");
+ return buffer.toString();
+ }
}
Modified: incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/main/resources/org/apache/uima/annotator/regex/regexMessages.properties
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/main/resources/org/apache/uima/annotator/regex/regexMessages.properties?rev=582868&r1=582867&r2=582868&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/main/resources/org/apache/uima/annotator/regex/regexMessages.properties (original)
+++ incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/main/resources/org/apache/uima/annotator/regex/regexMessages.properties Mon Oct 8 09:30:38 2007
@@ -25,4 +25,8 @@
regex_annotator_warning_duplicate_rule_id = "Duplicate rule id \"{0}\" found for concept \"{1}\"."
regex_annotator_error_duplicate_annotation_id = "Duplicate annotation id \"{0}\" for concept \"{1}\" found."
regex_annotator_error_referred_annotation_id_not_available = "The referred annotation id \"{0}\" is not available for concept \"{1}\"."
-regex_annotator_error_annotation_id_not_available = "The annotation id for annotations that set a 'Reference' type feature is missing in concept \"{0}\"."
\ No newline at end of file
+regex_annotator_error_annotation_id_not_available = "The annotation id for annotations that set a 'Reference' type feature is missing in concept \"{0}\"."
+regex_annotator_error_creating_custom_normalizer = "Error while creating custom normalizer for class {0}."
+regex_annotator_error_custom_normalizer_wrong_interface = "The error creation custom normalizer for class {0}. The class does not implement the required interface \"org.apache.uima.annotator.regex.Normalization\"."
+regex_annotator_error_custom_normalizer_not_specified = "The custom normalizer class is not specified for feature {0}.
+regex_annotator_error_normalizing_feature_value = "Error while normalizing feature value {0} for feature {1}.
\ No newline at end of file
Added: incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/java/org/apache/uima/annotator/regex/CustomTestNormalizer.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/java/org/apache/uima/annotator/regex/CustomTestNormalizer.java?rev=582868&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/java/org/apache/uima/annotator/regex/CustomTestNormalizer.java (added)
+++ incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/java/org/apache/uima/annotator/regex/CustomTestNormalizer.java Mon Oct 8 09:30:38 2007
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+package org.apache.uima.annotator.regex;
+
+/**
+ * custom test normalizer
+ *
+ */
+public class CustomTestNormalizer implements Normalization {
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.annotator.regex.Normalization#normalize(java.lang.String)
+ */
+ public String normalize(String input) {
+
+ //replace input string with Test Output
+ return "CustomTestNormalizerWorks";
+ }
+
+
+
+}
Modified: incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/java/org/apache/uima/annotator/regex/TestConceptFileSyntax.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/java/org/apache/uima/annotator/regex/TestConceptFileSyntax.java?rev=582868&r1=582867&r2=582868&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/java/org/apache/uima/annotator/regex/TestConceptFileSyntax.java (original)
+++ incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/java/org/apache/uima/annotator/regex/TestConceptFileSyntax.java Mon Oct 8 09:30:38 2007
@@ -45,82 +45,126 @@
public void testSyntaxDuplicateAnnotationIds() throws Exception {
// test annotator configuration with
// - duplicate annotation IDs within the same concept
+ String message = "";
try {
new AnnotatorTester(JUnitExtension
.getFile("conceptSyntax/RegExAnnotDuplicateAnnotId.xml"));
} catch (ResourceInitializationException ex) {
- String message = ex.getCause().getLocalizedMessage();
- Assert
- .assertTrue(
- "exception does not contain the duplicate annotation id: testannotation",
- message.indexOf("testannotation") > 0);
+ message = ex.getCause().getLocalizedMessage();
}
+ Assert
+ .assertTrue(
+ "exception does not contain the duplicate annotation id: testannotation",
+ message.indexOf("testannotation") > 0);
}
public void testSyntaxReferenceAnnotationIdNotAvaliable() throws Exception {
// test annotator configuration with
- // - duplicate annotation IDs within the same concept
+ // - missing annotation ID-
+ String message = "";
try {
new AnnotatorTester(JUnitExtension
.getFile("conceptSyntax/RegExAnnotReferenceFeature.xml"));
} catch (ResourceInitializationException ex) {
- String message = ex.getCause().getLocalizedMessage();
- Assert.assertTrue(
- "exception does not contain missing annotation id: refAnnotID",
- message.indexOf("refAnnotID") > 0);
+ message = ex.getCause().getLocalizedMessage();
}
+ Assert.assertTrue(
+ "exception does not contain missing annotation id: refAnnotID",
+ message.indexOf("refAnnotID") > 0);
}
public void testSyntaxReferenceAnnotationIdError() throws Exception {
// test annotator configuration with
// a missing annotation id for the annotation that has - duplicate
// annotation IDs within the same concept
+ String message = "";
try {
new AnnotatorTester(JUnitExtension
.getFile("conceptSyntax/RegExAnnotReferenceFeatureError.xml"));
} catch (ResourceInitializationException ex) {
- String message = ex.getCause().getLocalizedMessage();
- Assert.assertTrue(
- "exception does not contain the concept name: referenceFeatureValueError",
- message.indexOf("referenceFeatureValueError") > 0);
+ message = ex.getCause().getLocalizedMessage();
}
+ Assert
+ .assertTrue(
+ "exception does not contain the concept name: referenceFeatureValueError",
+ message.indexOf("referenceFeatureValueError") > 0);
}
public void testSyntaxRuleFileNotFound() throws Exception {
- // test annotator configuration with a concept file that could not be found
+ // test annotator configuration with a concept file that could not be
+ // found
// in the UIMA datapath or in the classpath
+ String message = "";
try {
new AnnotatorTester(JUnitExtension
.getFile("conceptSyntax/RegExAnnotRuleFileNotFound.xml"));
} catch (ResourceInitializationException ex) {
- String message = ex.getCause().getLocalizedMessage();
- Assert.assertTrue(
- "exception does not contain the file name: fileThatDoesNotExist.xml",
- message.indexOf("fileThatDoesNotExist.xml") > 0);
+ message = ex.getCause().getLocalizedMessage();
}
+ Assert
+ .assertTrue(
+ "exception does not contain the file name: fileThatDoesNotExist.xml",
+ message.indexOf("fileThatDoesNotExist.xml") > 0);
}
public void testSyntaxNotAllRuleFilesAvailable() throws Exception {
// test annotator configuration with more than one concept file
// where one of the concept files could not be found
+ String message = "";
try {
new AnnotatorTester(JUnitExtension
.getFile("conceptSyntax/RegExAnnotNotAllRuleFilesAvailable.xml"));
} catch (ResourceInitializationException ex) {
- String message = ex.getCause().getLocalizedMessage();
- Assert.assertTrue(
- "exception does not contain the file name: fileThatDoesNotExist.xml",
- message.indexOf("fileThatDoesNotExist.xml") > 0);
+ message = ex.getCause().getLocalizedMessage();
}
+ Assert
+ .assertTrue(
+ "exception does not contain the file name: fileThatDoesNotExist.xml",
+ message.indexOf("fileThatDoesNotExist.xml") > 0);
}
public void testSyntaxLoadRuleFileUsingDatapath() throws Exception {
// test annotator configuration with a concept file that is loaded
// using the UIMA datapath
ResourceManager rscMgr = UIMAFramework.newDefaultResourceManager();
- rscMgr.setDataPath(JUnitExtension.getFile("conceptSyntax").getAbsolutePath());
+ rscMgr.setDataPath(JUnitExtension.getFile("conceptSyntax")
+ .getAbsolutePath());
+ new AnnotatorTester(JUnitExtension.getFile(
+ "conceptSyntax/RegExAnnotLoadRuleFileUsingDatapath.xml")
+ .getAbsolutePath(), rscMgr);
+ }
+
+ public void testCustomNormalizationSyntaxError() throws Exception {
+ // test annotator configuration with more than one concept file
+ // where one of the concept files could not be found
+ String message = "";
+ try {
new AnnotatorTester(JUnitExtension
- .getFile("conceptSyntax/RegExAnnotLoadRuleFileUsingDatapath.xml").getAbsolutePath(), rscMgr);
+ .getFile("conceptSyntax/RegExAnnotCustomNormalizationSyntaxError.xml"));
+ } catch (ResourceInitializationException ex) {
+ message = ex.getCause().getLocalizedMessage();
+ }
+ Assert
+ .assertTrue(
+ "exception does not contain the file name: testFeatureCustomNormalizer",
+ message.indexOf("testFeatureCustomNormalizer") > 0);
}
+
+ public void testCustomNormalizationClassNotFound() throws Exception {
+ // test annotator configuration with more than one concept file
+ // where one of the concept files could not be found
+ String message = "";
+ try {
+ new AnnotatorTester(JUnitExtension
+ .getFile("conceptSyntax/RegExAnnotCustomNormalizationClassNotFound.xml"));
+ } catch (ResourceInitializationException ex) {
+ message = ex.getCause().getLocalizedMessage();
+ }
+ Assert
+ .assertTrue(
+ "exception does not contain the file name: CustomNormalizerTestClass",
+ message.indexOf("CustomNormalizerTestClass") > 0);
+ }
+
}
Modified: incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/java/org/apache/uima/annotator/regex/TestSetFeatureValues.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/java/org/apache/uima/annotator/regex/TestSetFeatureValues.java?rev=582868&r1=582867&r2=582868&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/java/org/apache/uima/annotator/regex/TestSetFeatureValues.java (original)
+++ incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/java/org/apache/uima/annotator/regex/TestSetFeatureValues.java Mon Oct 8 09:30:38 2007
@@ -33,7 +33,7 @@
public class TestSetFeatureValues extends TestCase {
/**
- * test all possible feature values and types
+ * test all possible feature values and types use Rule with id=ID1
*
* @throws Exception
*/
@@ -51,6 +51,10 @@
"org.apache.uima.TestAnnot:testFeature4", "org.apache.uima.TestAnnot:testFeature5",
"org.apache.uima.TestAnnot:testFeature6", "org.apache.uima.TestAnnot:testFeature7",
"org.apache.uima.TestAnnot:testFeature8", "org.apache.uima.TestAnnot:testFeature9",
+ "org.apache.uima.TestAnnot:testFeature10", "org.apache.uima.TestAnnot:testFeature11",
+ "org.apache.uima.TestAnnot:testFeature12", "org.apache.uima.TestAnnot:testFeature13",
+ "org.apache.uima.TestAnnot:testFeature14", "uima.tcas.DocumentAnnotation:language1",
+ "uima.tcas.DocumentAnnotation:language2",
"org.apache.uima.TestAnnot:confidenceValue", "org.apache.uima.TestAnnot:ruleId",
"org.apache.uima.TestAnnot1" };
@@ -64,7 +68,7 @@
/**
* test all possbible feature values and types with the second rule of a concept. Especially the
- * confidence and rule ID.
+ * confidence and rule ID. Use Rule with id=ID2
*
* @throws Exception
*/
@@ -82,6 +86,10 @@
"org.apache.uima.TestAnnot:testFeature4", "org.apache.uima.TestAnnot:testFeature5",
"org.apache.uima.TestAnnot:testFeature6", "org.apache.uima.TestAnnot:testFeature7",
"org.apache.uima.TestAnnot:testFeature8", "org.apache.uima.TestAnnot:testFeature9",
+ "org.apache.uima.TestAnnot:testFeature10", "org.apache.uima.TestAnnot:testFeature11",
+ "org.apache.uima.TestAnnot:testFeature12", "org.apache.uima.TestAnnot:testFeature13",
+ "org.apache.uima.TestAnnot:testFeature14", "uima.tcas.DocumentAnnotation:language1",
+ "uima.tcas.DocumentAnnotation:language2",
"org.apache.uima.TestAnnot:confidenceValue", "org.apache.uima.TestAnnot:ruleId",
"org.apache.uima.TestAnnot1" };
Added: incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/conceptSyntax/RegExAnnotCustomNormalizationClassNotFound.xml
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/conceptSyntax/RegExAnnotCustomNormalizationClassNotFound.xml?rev=582868&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/conceptSyntax/RegExAnnotCustomNormalizationClassNotFound.xml (added)
+++ incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/conceptSyntax/RegExAnnotCustomNormalizationClassNotFound.xml Mon Oct 8 09:30:38 2007
@@ -0,0 +1,91 @@
+<?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.
+ -->
+<analysisEngineDescription xmlns="http://uima.apache.org/resourceSpecifier">
+ <frameworkImplementation>org.apache.uima.java</frameworkImplementation>
+ <primitive>true</primitive>
+ <annotatorImplementationName>org.apache.uima.annotator.regex.impl.RegExAnnotator</annotatorImplementationName>
+ <analysisEngineMetaData>
+ <name>RegExAnnotator</name>
+ <description>Matches regular expressions in document text.</description>
+ <configurationParameters>
+
+ <configurationParameter>
+ <name>ProcessAllConceptRules</name>
+ <description>If this parameter is true, all rules of a concept are processed. If the parameter is false,
+ the rules are processed by confidence (hightest confidence value first) and the processing stops after the frist
+ rule where matches are available.
+ </description>
+ <type>Boolean</type>
+ <multiValued>false</multiValued>
+ <mandatory>false</mandatory>
+ </configurationParameter>
+
+ <configurationParameter>
+ <name>ConceptFiles</name>
+ <description>list of concept files to configure the annotator
+ </description>
+ <type>String</type>
+ <multiValued>true</multiValued>
+ <mandatory>true</mandatory>
+ </configurationParameter>
+
+
+ </configurationParameters>
+
+ <configurationParameterSettings>
+
+ <nameValuePair>
+ <name>ProcessAllConceptRules</name>
+ <value>
+ <boolean>false</boolean>
+ </value>
+ </nameValuePair>
+
+ <nameValuePair>
+ <name>ConceptFiles</name>
+ <value>
+ <array>
+ <string>conceptSyntax/customNormalizationClassNotFound.xml</string>
+ </array>
+ </value>
+ </nameValuePair>
+
+ </configurationParameterSettings>
+ <typeSystemDescription>
+ </typeSystemDescription>
+
+ <typePriorities>
+ </typePriorities>
+
+ <capabilities>
+ <capability>
+ <inputs/>
+ <outputs/>
+ <languagesSupported/>
+ </capability>
+ </capabilities>
+ <operationalProperties>
+ <modifiesCas>true</modifiesCas>
+ <multipleDeploymentAllowed>true</multipleDeploymentAllowed>
+ <outputsNewCASes>false</outputsNewCASes>
+ </operationalProperties>
+ </analysisEngineMetaData>
+
+</analysisEngineDescription>
Added: incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/conceptSyntax/RegExAnnotCustomNormalizationSyntaxError.xml
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/conceptSyntax/RegExAnnotCustomNormalizationSyntaxError.xml?rev=582868&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/conceptSyntax/RegExAnnotCustomNormalizationSyntaxError.xml (added)
+++ incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/conceptSyntax/RegExAnnotCustomNormalizationSyntaxError.xml Mon Oct 8 09:30:38 2007
@@ -0,0 +1,91 @@
+<?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.
+ -->
+<analysisEngineDescription xmlns="http://uima.apache.org/resourceSpecifier">
+ <frameworkImplementation>org.apache.uima.java</frameworkImplementation>
+ <primitive>true</primitive>
+ <annotatorImplementationName>org.apache.uima.annotator.regex.impl.RegExAnnotator</annotatorImplementationName>
+ <analysisEngineMetaData>
+ <name>RegExAnnotator</name>
+ <description>Matches regular expressions in document text.</description>
+ <configurationParameters>
+
+ <configurationParameter>
+ <name>ProcessAllConceptRules</name>
+ <description>If this parameter is true, all rules of a concept are processed. If the parameter is false,
+ the rules are processed by confidence (hightest confidence value first) and the processing stops after the frist
+ rule where matches are available.
+ </description>
+ <type>Boolean</type>
+ <multiValued>false</multiValued>
+ <mandatory>false</mandatory>
+ </configurationParameter>
+
+ <configurationParameter>
+ <name>ConceptFiles</name>
+ <description>list of concept files to configure the annotator
+ </description>
+ <type>String</type>
+ <multiValued>true</multiValued>
+ <mandatory>true</mandatory>
+ </configurationParameter>
+
+
+ </configurationParameters>
+
+ <configurationParameterSettings>
+
+ <nameValuePair>
+ <name>ProcessAllConceptRules</name>
+ <value>
+ <boolean>false</boolean>
+ </value>
+ </nameValuePair>
+
+ <nameValuePair>
+ <name>ConceptFiles</name>
+ <value>
+ <array>
+ <string>conceptSyntax/customNormalizationSyntaxError.xml</string>
+ </array>
+ </value>
+ </nameValuePair>
+
+ </configurationParameterSettings>
+ <typeSystemDescription>
+ </typeSystemDescription>
+
+ <typePriorities>
+ </typePriorities>
+
+ <capabilities>
+ <capability>
+ <inputs/>
+ <outputs/>
+ <languagesSupported/>
+ </capability>
+ </capabilities>
+ <operationalProperties>
+ <modifiesCas>true</modifiesCas>
+ <multipleDeploymentAllowed>true</multipleDeploymentAllowed>
+ <outputsNewCASes>false</outputsNewCASes>
+ </operationalProperties>
+ </analysisEngineMetaData>
+
+</analysisEngineDescription>
Added: incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/conceptSyntax/customNormalizationClassNotFound.xml
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/conceptSyntax/customNormalizationClassNotFound.xml?rev=582868&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/conceptSyntax/customNormalizationClassNotFound.xml (added)
+++ incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/conceptSyntax/customNormalizationClassNotFound.xml Mon Oct 8 09:30:38 2007
@@ -0,0 +1,35 @@
+<?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" xsi:noNamespaceSchemaLocation="concept.xsd">
+
+ <concept name="featureValues">
+ <rules>
+ <rule ruleId="ID1" regEx="(Rule)(Regex)(1)(2.4)" matchStrategy="matchAll" matchType="uima.tcas.DocumentAnnotation" confidence="1.0">
+ </rule>
+ </rules>
+ <createAnnotations>
+ <annotation id="testannot" type="org.apache.uima.TestAnnot">
+ <begin group="0"/>
+ <end group="0"/>
+ <setFeature name="testFeatureCustomNormalizer" type="String" normalization="Custom" class="CustomNormalizerTestClass">$1 test $2</setFeature>
+ </annotation>
+ </createAnnotations>
+ </concept>
+</conceptSet>
Added: incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/conceptSyntax/customNormalizationSyntaxError.xml
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/conceptSyntax/customNormalizationSyntaxError.xml?rev=582868&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/conceptSyntax/customNormalizationSyntaxError.xml (added)
+++ incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/conceptSyntax/customNormalizationSyntaxError.xml Mon Oct 8 09:30:38 2007
@@ -0,0 +1,35 @@
+<?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" xsi:noNamespaceSchemaLocation="concept.xsd">
+
+ <concept name="featureValues">
+ <rules>
+ <rule ruleId="ID1" regEx="(Rule)(Regex)(1)(2.4)" matchStrategy="matchAll" matchType="uima.tcas.DocumentAnnotation" confidence="1.0">
+ </rule>
+ </rules>
+ <createAnnotations>
+ <annotation id="testannot" type="org.apache.uima.TestAnnot">
+ <begin group="0"/>
+ <end group="0"/>
+ <setFeature name="testFeatureCustomNormalizer" type="String" normalization="Custom">$1 test $2</setFeature>
+ </annotation>
+ </createAnnotations>
+ </concept>
+</conceptSet>
Modified: incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/setFeatureValues/RegExAnnotFeatureValues.xml
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/setFeatureValues/RegExAnnotFeatureValues.xml?rev=582868&r1=582867&r2=582868&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/setFeatureValues/RegExAnnotFeatureValues.xml (original)
+++ incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/setFeatureValues/RegExAnnotFeatureValues.xml Mon Oct 8 09:30:38 2007
@@ -130,6 +130,36 @@
<description/>
<rangeTypeName>uima.cas.Integer</rangeTypeName>
</featureDescription>
+
+ <featureDescription>
+ <name>testFeature10</name>
+ <description/>
+ <rangeTypeName>uima.cas.String</rangeTypeName>
+ </featureDescription>
+
+ <featureDescription>
+ <name>testFeature11</name>
+ <description/>
+ <rangeTypeName>uima.cas.String</rangeTypeName>
+ </featureDescription>
+
+ <featureDescription>
+ <name>testFeature12</name>
+ <description/>
+ <rangeTypeName>uima.cas.String</rangeTypeName>
+ </featureDescription>
+
+ <featureDescription>
+ <name>testFeature13</name>
+ <description/>
+ <rangeTypeName>uima.cas.String</rangeTypeName>
+ </featureDescription>
+
+ <featureDescription>
+ <name>testFeature14</name>
+ <description/>
+ <rangeTypeName>uima.cas.String</rangeTypeName>
+ </featureDescription>
<featureDescription>
<name>confidenceValue</name>
@@ -148,6 +178,25 @@
<description/>
<supertypeName>uima.tcas.Annotation</supertypeName>
</typeDescription>
+
+ <typeDescription>
+ <name>uima.tcas.DocumentAnnotation</name>
+ <description/>
+ <supertypeName>uima.tcas.Annotation</supertypeName>
+ <features>
+ <featureDescription>
+ <name>language1</name>
+ <description/>
+ <rangeTypeName>uima.cas.String</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>language2</name>
+ <description/>
+ <rangeTypeName>uima.cas.String</rangeTypeName>
+ </featureDescription>
+ </features>
+ </typeDescription>
+
</types>
</typeSystemDescription>
Modified: incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/setFeatureValues/featureValues.xml
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/setFeatureValues/featureValues.xml?rev=582868&r1=582867&r2=582868&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/setFeatureValues/featureValues.xml (original)
+++ incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/setFeatureValues/featureValues.xml Mon Oct 8 09:30:38 2007
@@ -24,6 +24,8 @@
<rule ruleId="ID1" regEx="(Rule)(Regex)(1)(2.4)" matchStrategy="matchAll" matchType="uima.tcas.DocumentAnnotation" confidence="1.0">
<updateMatchTypeAnnotation>
<setFeature name="language" type="String">$0 Test</setFeature>
+ <setFeature name="language1" type="String" normalization="ToUpperCase">$0 Test</setFeature>
+ <setFeature name="language2" type="String" normalization="Custom" class="org.apache.uima.annotator.regex.CustomTestNormalizer">$0</setFeature>
</updateMatchTypeAnnotation>
</rule>
<rule ruleId="ID2" regEx="(Rule)(Regex)(2)(2.4)" matchStrategy="matchAll" matchType="uima.tcas.DocumentAnnotation" confidence="0.7">
@@ -40,8 +42,13 @@
<setFeature name="testFeature1" type="String">$1$2$3</setFeature>
<setFeature name="testFeature2" type="String">$2 with additions</setFeature>
<setFeature name="testFeature3" type="String">value only</setFeature>
- <setFeature name="testFeature4" type="String">frist $0</setFeature>
-
+ <setFeature name="testFeature4" type="String">frist $0</setFeature>
+ <setFeature name="testFeature10" type="String" normalization="ToLowerCase">VALUE OnLy</setFeature>
+ <setFeature name="testFeature11" type="String" normalization="ToUpperCase">value only</setFeature>
+ <setFeature name="testFeature12" type="String" normalization="ToLowerCase">$0</setFeature>
+ <setFeature name="testFeature13" type="String" normalization="ToUpperCase">$1 test $2</setFeature>
+ <setFeature name="testFeature14" type="String" normalization="Custom" class="org.apache.uima.annotator.regex.CustomTestNormalizer">$1 test $2</setFeature>
+
<setFeature name="testFeature6" type="Float">2343.34</setFeature>
<setFeature name="testFeature7" type="Float">$4</setFeature>
Modified: incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/setFeatureValues/featureValuesRef.txt
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/setFeatureValues/featureValuesRef.txt?rev=582868&r1=582867&r2=582868&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/setFeatureValues/featureValuesRef.txt (original)
+++ incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/setFeatureValues/featureValuesRef.txt Mon Oct 8 09:30:38 2007
@@ -1,6 +1,6 @@
TestAnnot1(0,13): RuleRegex12.4
-DocumentAnnotation(0,13): RuleRegex12.4 { language=RuleRegex12.4 Test }
-TestAnnot(0,13): RuleRegex12.4 { confidenceValue=1.0, ruleId=ID1, testFeature0=RuleRegex12.4, testFeature1=RuleRegex1, testFeature2=Regex with additions, testFeature3=value only, testFeature4=frist RuleRegex12.4, testFeature5=TestAnnot1 "RuleRegex12.4"
+DocumentAnnotation(0,13): RuleRegex12.4 { language=RuleRegex12.4 Test, language1=RULEREGEX12.4 TEST, language2=CustomTestNormalizerWorks }
+TestAnnot(0,13): RuleRegex12.4 { confidenceValue=1.0, ruleId=ID1, testFeature0=RuleRegex12.4, testFeature1=RuleRegex1, testFeature10=value only, testFeature11=VALUE ONLY, testFeature12=ruleregex12.4, testFeature13=RULE TEST REGEX, testFeature14=CustomTestNormalizerWorks, testFeature2=Regex with additions, testFeature3=value only, testFeature4=frist RuleRegex12.4, testFeature5=TestAnnot1 "RuleRegex12.4"
sofa: _InitialView
begin: 0
end: 13
Modified: incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/setFeatureValues/featureValuesRef2.txt
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/setFeatureValues/featureValuesRef2.txt?rev=582868&r1=582867&r2=582868&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/setFeatureValues/featureValuesRef2.txt (original)
+++ incubator/uima/sandbox/trunk/RegularExpressionAnnotator/src/test/resources/setFeatureValues/featureValuesRef2.txt Mon Oct 8 09:30:38 2007
@@ -1,6 +1,6 @@
TestAnnot1(0,13): RuleRegex22.4
-DocumentAnnotation(0,13): RuleRegex22.4 { language=Rule }
-TestAnnot(0,13): RuleRegex22.4 { confidenceValue=0.7, ruleId=ID2, testFeature0=RuleRegex22.4, testFeature1=RuleRegex2, testFeature2=Regex with additions, testFeature3=value only, testFeature4=frist RuleRegex22.4, testFeature5=TestAnnot1 "RuleRegex22.4"
+DocumentAnnotation(0,13): RuleRegex22.4 { language=Rule, language1=null, language2=null }
+TestAnnot(0,13): RuleRegex22.4 { confidenceValue=0.7, ruleId=ID2, testFeature0=RuleRegex22.4, testFeature1=RuleRegex2, testFeature10=value only, testFeature11=VALUE ONLY, testFeature12=ruleregex22.4, testFeature13=RULE TEST REGEX, testFeature14=CustomTestNormalizerWorks, testFeature2=Regex with additions, testFeature3=value only, testFeature4=frist RuleRegex22.4, testFeature5=TestAnnot1 "RuleRegex22.4"
sofa: _InitialView
begin: 0
end: 13