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/11/22 17:24:38 UTC
svn commit: r597449 - in
/incubator/uima/sandbox/trunk/DictionaryAnnotator/src:
main/java/org/apache/uima/annotator/dict_annot/dictionary/impl/
main/java/org/apache/uima/annotator/dict_annot/impl/
test/java/org/apache/uima/annotator/dict_annot/ test/ja...
Author: mbaessler
Date: Thu Nov 22 08:24:37 2007
New Revision: 597449
URL: http://svn.apache.org/viewvc?rev=597449&view=rev
Log:
UIMA-647
add DictionaryAnnotator tests
https://issues.apache.org/jira/browse/UIMA-647
Added:
incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/java/org/apache/uima/annotator/dict_annot/DictionaryAnnotatorTest.java
incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/
incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/DictionaryAnnotator.xml
incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/DictionaryAnnotatorDictFileNotFound.xml
incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/DictionaryAnnotatorInvalidInputType.xml
incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/DictionaryAnnotatorInvalidOutputType.xml
incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/dictionaryAnnotTestRef.txt
incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/testDict.xml
incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryBuilderTests/DictionaryPrintingRef.txt
incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryBuilderTests/InvalidDictFile.xml
incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryBuilderTests/InvalidDictFile2.xml
Removed:
incubator/uima/sandbox/trunk/DictionaryAnnotator/src/main/java/org/apache/uima/annotator/dict_annot/dictionary/impl/DictionaryBuilderException.java
Modified:
incubator/uima/sandbox/trunk/DictionaryAnnotator/src/main/java/org/apache/uima/annotator/dict_annot/impl/DictionaryAnnotator.java
incubator/uima/sandbox/trunk/DictionaryAnnotator/src/main/java/org/apache/uima/annotator/dict_annot/impl/DictionaryAnnotatorProcessException.java
incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/java/org/apache/uima/annotator/dict_annot/dictionary/DictionaryBuilderTest.java
Modified: incubator/uima/sandbox/trunk/DictionaryAnnotator/src/main/java/org/apache/uima/annotator/dict_annot/impl/DictionaryAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/DictionaryAnnotator/src/main/java/org/apache/uima/annotator/dict_annot/impl/DictionaryAnnotator.java?rev=597449&r1=597448&r2=597449&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/DictionaryAnnotator/src/main/java/org/apache/uima/annotator/dict_annot/impl/DictionaryAnnotator.java (original)
+++ incubator/uima/sandbox/trunk/DictionaryAnnotator/src/main/java/org/apache/uima/annotator/dict_annot/impl/DictionaryAnnotator.java Thu Nov 22 08:24:37 2007
@@ -104,10 +104,9 @@
this.dictionaries[i].getTypeName());
// check output type and throw an exception in case of errors
if (currentDictOutputType == null) {
- Exception ex = new DictionaryAnnotatorConfigException(
+ throw new DictionaryAnnotatorProcessException(
"dictionary_annotator_error_resolving_types",
- new Object[] { this.inputMatchTypeStr });
- throw new AnalysisEngineProcessException(ex);
+ new Object[] { this.dictionaries[i].getTypeName() });
}
// iterate over the annotation array and detect matches
Modified: incubator/uima/sandbox/trunk/DictionaryAnnotator/src/main/java/org/apache/uima/annotator/dict_annot/impl/DictionaryAnnotatorProcessException.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/DictionaryAnnotator/src/main/java/org/apache/uima/annotator/dict_annot/impl/DictionaryAnnotatorProcessException.java?rev=597449&r1=597448&r2=597449&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/DictionaryAnnotator/src/main/java/org/apache/uima/annotator/dict_annot/impl/DictionaryAnnotatorProcessException.java (original)
+++ incubator/uima/sandbox/trunk/DictionaryAnnotator/src/main/java/org/apache/uima/annotator/dict_annot/impl/DictionaryAnnotatorProcessException.java Thu Nov 22 08:24:37 2007
@@ -45,36 +45,4 @@
Object[] aArguments) {
super(DictionaryAnnotator.MESSAGE_DIGEST, aMessageKey, aArguments);
}
-
- /**
- * Creates a new exception with the specified cause and a message from the
- * DictionaryAnnotator message catalog.
- *
- * @param aMessageKey
- * an identifier that maps to the message for this exception. The
- * message may contain place holders for arguments as defined by
- * the {@link java.text.MessageFormat MessageFormat} class.
- * @param aArguments
- * The arguments to the message. <code>null</code> may be used if
- * the message has no arguments.
- * @param aCause
- * the original exception that caused this exception to be thrown,
- * if any
- */
- public DictionaryAnnotatorProcessException(String aMessageKey,
- Object[] aArguments, Throwable aCause) {
- super(DictionaryAnnotator.MESSAGE_DIGEST, aMessageKey, aArguments, aCause);
- }
-
- /**
- * Creates a new exception with the specified cause and a null message.
- *
- * @param aCause
- * the original exception that caused this exception to be thrown, if any
- */
- public DictionaryAnnotatorProcessException(Throwable aCause) {
- super(aCause);
- }
-
-
}
Added: incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/java/org/apache/uima/annotator/dict_annot/DictionaryAnnotatorTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/java/org/apache/uima/annotator/dict_annot/DictionaryAnnotatorTest.java?rev=597449&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/java/org/apache/uima/annotator/dict_annot/DictionaryAnnotatorTest.java (added)
+++ incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/java/org/apache/uima/annotator/dict_annot/DictionaryAnnotatorTest.java Thu Nov 22 08:24:37 2007
@@ -0,0 +1,133 @@
+/*
+ * 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.dict_annot;
+
+import java.io.File;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import org.apache.uima.annotator.dict_annot.impl.DictionaryAnnotatorProcessException;
+import org.apache.uima.cas.CAS;
+import org.apache.uima.resource.ResourceInitializationException;
+import org.apache.uima.test.junit_extension.AnnotatorTester;
+import org.apache.uima.test.junit_extension.JUnitExtension;
+
+/**
+ * Dictionary annotator test. This test class tests the dictionary annotator
+ * code and does not focus on dictionary matching.
+ */
+public class DictionaryAnnotatorTest extends TestCase {
+
+ /**
+ * Test the dictionary annotator processing.
+ *
+ * @throws Exception
+ */
+ public void testDictionaryAnnotator() throws Exception {
+
+ // create annotation tester with the dictionary annotator specifier
+ AnnotatorTester annotTester = new AnnotatorTester(JUnitExtension
+ .getFile("DictionaryAnnotatorTests/DictionaryAnnotator.xml"));
+ CAS cas = annotTester.performTest("nEw yOrk City", "en");
+
+ // define result interested in
+ String[] tofs = { "org.apache.uima.DictionaryEntry" };
+
+ // compare results
+ File outputFile = new File(JUnitExtension
+ .getFile("DictionaryAnnotatorTests"),
+ "dictionaryAnnotTest_testoutput.txt");
+ AnnotatorTester.checkResult(cas, tofs, JUnitExtension
+ .getFile("DictionaryAnnotatorTests/dictionaryAnnotTestRef.txt"),
+ outputFile);
+ }
+
+ /**
+ * The test dictionary annotator processing with an invalid input type
+ *
+ * @throws Exception
+ */
+ public void testDictionaryAnnotatorInvalidInputType() throws Exception {
+
+ // create annotation tester with the dictionary annotator specifier
+ AnnotatorTester annotTester = new AnnotatorTester(
+ JUnitExtension
+ .getFile("DictionaryAnnotatorTests/DictionaryAnnotatorInvalidInputType.xml"));
+
+ boolean foundMessage = false;
+ try {
+ annotTester.performTest("Dummy text", "en");
+ } catch (DictionaryAnnotatorProcessException ex) {
+ String message = ex.getMessage();
+ if (message.indexOf("org.apache.uima.InvalidInputType") > -1) {
+ foundMessage = true;
+ }
+ }
+ Assert.assertTrue(foundMessage);
+ }
+
+ /**
+ * The test dictionary annotator processing with an invalid output type
+ *
+ * @throws Exception
+ */
+ public void testDictionaryAnnotatorInvalidOutputType() throws Exception {
+
+ // create annotation tester with the dictionary annotator specifier
+ AnnotatorTester annotTester = new AnnotatorTester(
+ JUnitExtension
+ .getFile("DictionaryAnnotatorTests/DictionaryAnnotatorInvalidOutputType.xml"));
+
+ boolean foundMessage = false;
+ try {
+ annotTester.performTest("Dummy text", "en");
+ } catch (DictionaryAnnotatorProcessException ex) {
+ String message = ex.getMessage();
+ if (message.indexOf("org.apache.uima.DictionaryEntry") > -1) {
+ foundMessage = true;
+ }
+ }
+ Assert.assertTrue(foundMessage);
+ }
+
+ /**
+ * The test dictionary annotator processing - dictionary file not found
+ *
+ * @throws Exception
+ */
+ public void testDictionaryAnnotatorDictFileNotFound() throws Exception {
+
+ boolean foundMessage = false;
+ try {
+ // create annotation tester with the dictionary annotator specifier
+ new AnnotatorTester(
+ JUnitExtension
+ .getFile("DictionaryAnnotatorTests/DictionaryAnnotatorDictFileNotFound.xml"));
+ } catch (ResourceInitializationException ex) {
+ String message = ex.getCause().getMessage();
+ if (message.indexOf("fileNotFound.xml") > -1) {
+ foundMessage = true;
+ }
+ }
+ Assert.assertTrue(foundMessage);
+
+ }
+
+}
Modified: incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/java/org/apache/uima/annotator/dict_annot/dictionary/DictionaryBuilderTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/java/org/apache/uima/annotator/dict_annot/dictionary/DictionaryBuilderTest.java?rev=597449&r1=597448&r2=597449&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/java/org/apache/uima/annotator/dict_annot/dictionary/DictionaryBuilderTest.java (original)
+++ incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/java/org/apache/uima/annotator/dict_annot/dictionary/DictionaryBuilderTest.java Thu Nov 22 08:24:37 2007
@@ -21,6 +21,7 @@
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
+import java.io.FileWriter;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.StringTokenizer;
@@ -35,6 +36,7 @@
import org.apache.uima.annotator.dict_annot.dictionary.impl.HashMapDictionary;
import org.apache.uima.annotator.dict_annot.dictionary.impl.HashMapDictionaryBuilder;
import org.apache.uima.annotator.dict_annot.impl.DictionaryAnnotatorConfigException;
+import org.apache.uima.test.junit_extension.FileCompare;
import org.apache.uima.test.junit_extension.JUnitExtension;
/**
@@ -145,7 +147,8 @@
for (int i = 0; i < entries.size(); i++) {
- StringTokenizer tokenizer = new StringTokenizer(entries.get(i), dictBuilder.getMultiWordSeparator());
+ StringTokenizer tokenizer = new StringTokenizer(entries.get(i),
+ dictBuilder.getMultiWordSeparator());
ArrayList<String> list = new ArrayList<String>();
while (tokenizer.hasMoreTokens()) {
@@ -191,7 +194,8 @@
for (int i = 0; i < entries.size(); i++) {
- StringTokenizer tokenizer = new StringTokenizer(entries.get(i), dictBuilder.getMultiWordSeparator());
+ StringTokenizer tokenizer = new StringTokenizer(entries.get(i),
+ dictBuilder.getMultiWordSeparator());
ArrayList<String> list = new ArrayList<String>();
while (tokenizer.hasMoreTokens()) {
@@ -238,7 +242,8 @@
for (int i = 0; i < entries.size(); i++) {
- StringTokenizer tokenizer = new StringTokenizer(entries.get(i), dictBuilder.getMultiWordSeparator());
+ StringTokenizer tokenizer = new StringTokenizer(entries.get(i),
+ dictBuilder.getMultiWordSeparator());
ArrayList<String> list = new ArrayList<String>();
while (tokenizer.hasMoreTokens()) {
@@ -295,4 +300,107 @@
return dictEntries;
}
+ /**
+ * test building an invalid XML dictionary file
+ *
+ * @throws Exception
+ */
+ public void testBuildingInvalidDictFile() throws Exception {
+
+ // read input file
+ File dictFile = JUnitExtension
+ .getFile("DictionaryBuilderTests/InvalidDictFile.xml");
+ InputStream stream = new BufferedInputStream(
+ new FileInputStream(dictFile));
+
+ // create dictionary
+ HashMapDictionaryBuilder dictBuilder = new HashMapDictionaryBuilder();
+ // create dictionary file parser
+ DictionaryFileParser fileParser = new DictionaryFileParserImpl();
+
+ boolean foundMessage = false;
+
+ try {
+ fileParser.parseDictionaryFile(dictFile.getAbsolutePath(), stream,
+ dictBuilder);
+ } catch (DictionaryAnnotatorConfigException ex) {
+ String message = ex.getMessage();
+ if (message.indexOf("InvalidDictFile.xml") > -1) {
+ foundMessage = true;
+ }
+
+ }
+ Assert.assertTrue(foundMessage);
+ }
+
+ /**
+ * test building an invalid XML dictionary file
+ *
+ * @throws Exception
+ */
+ public void testBuildingInvalidDictFile2() throws Exception {
+
+ // read input file
+ File dictFile = JUnitExtension
+ .getFile("DictionaryBuilderTests/InvalidDictFile2.xml");
+ InputStream stream = new BufferedInputStream(
+ new FileInputStream(dictFile));
+
+ // create dictionary
+ HashMapDictionaryBuilder dictBuilder = new HashMapDictionaryBuilder();
+ // create dictionary file parser
+ DictionaryFileParser fileParser = new DictionaryFileParserImpl();
+
+ boolean foundMessage = false;
+
+ try {
+ fileParser.parseDictionaryFile(dictFile.getAbsolutePath(), stream,
+ dictBuilder);
+ } catch (DictionaryAnnotatorConfigException ex) {
+ String message = ex.getMessage();
+ if (message.indexOf("InvalidDictFile2.xml") > -1) {
+ foundMessage = true;
+ }
+
+ }
+ Assert.assertTrue(foundMessage);
+ }
+
+ /**
+ * test dictionary printing
+ *
+ * @throws Exception
+ */
+ public void testDictionaryPrinting() throws Exception {
+
+ // read input file
+ File dictFile = JUnitExtension
+ .getFile("DictionaryBuilderTests/MultiWordsSpecialMultiWordSeparator.xml");
+ InputStream stream = new BufferedInputStream(
+ new FileInputStream(dictFile));
+
+ // create dictionary
+ HashMapDictionaryBuilder dictBuilder = new HashMapDictionaryBuilder();
+ // create dictionary file parser
+ DictionaryFileParser fileParser = new DictionaryFileParserImpl();
+ fileParser.parseDictionaryFile(dictFile.getAbsolutePath(), stream,
+ dictBuilder);
+ HashMapDictionary dict = (HashMapDictionary) dictBuilder.getDictionary();
+
+ //create dictionary content output file
+ File outputFile = new File(JUnitExtension
+ .getFile("DictionaryBuilderTests"),
+ "dictionaryPrinting_testoutput.txt");
+ FileWriter writer = new FileWriter(outputFile);
+
+ //print dictionary content to file
+ dict.printDictionary(writer);
+
+ writer.flush();
+ writer.close();
+
+ //compare dictionary content with reference content
+ FileCompare.compare(outputFile, JUnitExtension
+ .getFile("DictionaryBuilderTests/dictionaryPrintingRef.txt"));
+ }
}
Added: incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/DictionaryAnnotator.xml
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/DictionaryAnnotator.xml?rev=597449&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/DictionaryAnnotator.xml (added)
+++ incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/DictionaryAnnotator.xml Thu Nov 22 08:24:37 2007
@@ -0,0 +1,90 @@
+<?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.dict_annot.impl.DictionaryAnnotator</annotatorImplementationName>
+ <analysisEngineMetaData>
+ <name>DictionaryAnnotator</name>
+ <description></description>
+ <configurationParameters>
+
+ <configurationParameter>
+ <name>DictionaryFiles</name>
+ <description>list of dictionary files to configure the annotator</description>
+ <type>String</type>
+ <multiValued>true</multiValued>
+ <mandatory>true</mandatory>
+ </configurationParameter>
+
+ <configurationParameter>
+ <name>InputMatchType</name>
+ <description></description>
+ <type>String</type>
+ <multiValued>false</multiValued>
+ <mandatory>true</mandatory>
+ </configurationParameter>
+
+ </configurationParameters>
+
+ <configurationParameterSettings>
+
+ <nameValuePair>
+ <name>DictionaryFiles</name>
+ <value>
+ <array>
+ <string>DictionaryAnnotatorTests/testDict.xml</string>
+ </array>
+ </value>
+ </nameValuePair>
+
+ <nameValuePair>
+ <name>InputMatchType</name>
+ <value>
+ <string>uima.tcas.DocumentAnnotation</string>
+ </value>
+ </nameValuePair>
+
+ </configurationParameterSettings>
+ <typeSystemDescription>
+ <types>
+ <typeDescription>
+ <name>org.apache.uima.DictionaryEntry</name>
+ <description/>
+ <supertypeName>uima.tcas.Annotation</supertypeName>
+ </typeDescription>
+ </types>
+ </typeSystemDescription>
+ <capabilities>
+ <capability>
+ <inputs/>
+ <outputs>
+ </outputs>
+ <languagesSupported/>
+ </capability>
+ </capabilities>
+ <operationalProperties>
+ <modifiesCas>true</modifiesCas>
+ <multipleDeploymentAllowed>true</multipleDeploymentAllowed>
+ <outputsNewCASes>false</outputsNewCASes>
+ </operationalProperties>
+ </analysisEngineMetaData>
+
+</analysisEngineDescription>
Added: incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/DictionaryAnnotatorDictFileNotFound.xml
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/DictionaryAnnotatorDictFileNotFound.xml?rev=597449&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/DictionaryAnnotatorDictFileNotFound.xml (added)
+++ incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/DictionaryAnnotatorDictFileNotFound.xml Thu Nov 22 08:24:37 2007
@@ -0,0 +1,90 @@
+<?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.dict_annot.impl.DictionaryAnnotator</annotatorImplementationName>
+ <analysisEngineMetaData>
+ <name>DictionaryAnnotator</name>
+ <description></description>
+ <configurationParameters>
+
+ <configurationParameter>
+ <name>DictionaryFiles</name>
+ <description>list of dictionary files to configure the annotator</description>
+ <type>String</type>
+ <multiValued>true</multiValued>
+ <mandatory>true</mandatory>
+ </configurationParameter>
+
+ <configurationParameter>
+ <name>InputMatchType</name>
+ <description></description>
+ <type>String</type>
+ <multiValued>false</multiValued>
+ <mandatory>true</mandatory>
+ </configurationParameter>
+
+ </configurationParameters>
+
+ <configurationParameterSettings>
+
+ <nameValuePair>
+ <name>DictionaryFiles</name>
+ <value>
+ <array>
+ <string>fileNotFound.xml</string>
+ </array>
+ </value>
+ </nameValuePair>
+
+ <nameValuePair>
+ <name>InputMatchType</name>
+ <value>
+ <string>uima.tcas.DocumentAnnotation</string>
+ </value>
+ </nameValuePair>
+
+ </configurationParameterSettings>
+ <typeSystemDescription>
+ <types>
+ <typeDescription>
+ <name>org.apache.uima.DictionaryEntry</name>
+ <description/>
+ <supertypeName>uima.tcas.Annotation</supertypeName>
+ </typeDescription>
+ </types>
+ </typeSystemDescription>
+ <capabilities>
+ <capability>
+ <inputs/>
+ <outputs>
+ </outputs>
+ <languagesSupported/>
+ </capability>
+ </capabilities>
+ <operationalProperties>
+ <modifiesCas>true</modifiesCas>
+ <multipleDeploymentAllowed>true</multipleDeploymentAllowed>
+ <outputsNewCASes>false</outputsNewCASes>
+ </operationalProperties>
+ </analysisEngineMetaData>
+
+</analysisEngineDescription>
Added: incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/DictionaryAnnotatorInvalidInputType.xml
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/DictionaryAnnotatorInvalidInputType.xml?rev=597449&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/DictionaryAnnotatorInvalidInputType.xml (added)
+++ incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/DictionaryAnnotatorInvalidInputType.xml Thu Nov 22 08:24:37 2007
@@ -0,0 +1,90 @@
+<?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.dict_annot.impl.DictionaryAnnotator</annotatorImplementationName>
+ <analysisEngineMetaData>
+ <name>DictionaryAnnotator</name>
+ <description></description>
+ <configurationParameters>
+
+ <configurationParameter>
+ <name>DictionaryFiles</name>
+ <description>list of dictionary files to configure the annotator</description>
+ <type>String</type>
+ <multiValued>true</multiValued>
+ <mandatory>true</mandatory>
+ </configurationParameter>
+
+ <configurationParameter>
+ <name>InputMatchType</name>
+ <description></description>
+ <type>String</type>
+ <multiValued>false</multiValued>
+ <mandatory>true</mandatory>
+ </configurationParameter>
+
+ </configurationParameters>
+
+ <configurationParameterSettings>
+
+ <nameValuePair>
+ <name>DictionaryFiles</name>
+ <value>
+ <array>
+ <string>DictionaryAnnotatorTests/testDict.xml</string>
+ </array>
+ </value>
+ </nameValuePair>
+
+ <nameValuePair>
+ <name>InputMatchType</name>
+ <value>
+ <string>org.apache.uima.InvalidInputType</string>
+ </value>
+ </nameValuePair>
+
+ </configurationParameterSettings>
+ <typeSystemDescription>
+ <types>
+ <typeDescription>
+ <name>org.apache.uima.DictionaryEntry</name>
+ <description/>
+ <supertypeName>uima.tcas.Annotation</supertypeName>
+ </typeDescription>
+ </types>
+ </typeSystemDescription>
+ <capabilities>
+ <capability>
+ <inputs/>
+ <outputs>
+ </outputs>
+ <languagesSupported/>
+ </capability>
+ </capabilities>
+ <operationalProperties>
+ <modifiesCas>true</modifiesCas>
+ <multipleDeploymentAllowed>true</multipleDeploymentAllowed>
+ <outputsNewCASes>false</outputsNewCASes>
+ </operationalProperties>
+ </analysisEngineMetaData>
+
+</analysisEngineDescription>
Added: incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/DictionaryAnnotatorInvalidOutputType.xml
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/DictionaryAnnotatorInvalidOutputType.xml?rev=597449&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/DictionaryAnnotatorInvalidOutputType.xml (added)
+++ incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/DictionaryAnnotatorInvalidOutputType.xml Thu Nov 22 08:24:37 2007
@@ -0,0 +1,86 @@
+<?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.dict_annot.impl.DictionaryAnnotator</annotatorImplementationName>
+ <analysisEngineMetaData>
+ <name>DictionaryAnnotator</name>
+ <description></description>
+ <configurationParameters>
+
+ <configurationParameter>
+ <name>DictionaryFiles</name>
+ <description>list of dictionary files to configure the annotator</description>
+ <type>String</type>
+ <multiValued>true</multiValued>
+ <mandatory>true</mandatory>
+ </configurationParameter>
+
+ <configurationParameter>
+ <name>InputMatchType</name>
+ <description></description>
+ <type>String</type>
+ <multiValued>false</multiValued>
+ <mandatory>true</mandatory>
+ </configurationParameter>
+
+ </configurationParameters>
+
+ <configurationParameterSettings>
+
+ <nameValuePair>
+ <name>DictionaryFiles</name>
+ <value>
+ <array>
+ <string>DictionaryAnnotatorTests/testDict.xml</string>
+ </array>
+ </value>
+ </nameValuePair>
+
+ <nameValuePair>
+ <name>InputMatchType</name>
+ <value>
+ <string>uima.tcas.DocumentAnnotation</string>
+ </value>
+ </nameValuePair>
+
+ </configurationParameterSettings>
+ <typeSystemDescription>
+ <types>
+
+ </types>
+ </typeSystemDescription>
+ <capabilities>
+ <capability>
+ <inputs/>
+ <outputs>
+ </outputs>
+ <languagesSupported/>
+ </capability>
+ </capabilities>
+ <operationalProperties>
+ <modifiesCas>true</modifiesCas>
+ <multipleDeploymentAllowed>true</multipleDeploymentAllowed>
+ <outputsNewCASes>false</outputsNewCASes>
+ </operationalProperties>
+ </analysisEngineMetaData>
+
+</analysisEngineDescription>
Added: incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/dictionaryAnnotTestRef.txt
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/dictionaryAnnotTestRef.txt?rev=597449&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/dictionaryAnnotTestRef.txt (added)
+++ incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/dictionaryAnnotTestRef.txt Thu Nov 22 08:24:37 2007
@@ -0,0 +1 @@
+DictionaryEntry(0,13): nEw yOrk City
Added: incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/testDict.xml
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/testDict.xml?rev=597449&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/testDict.xml (added)
+++ incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryAnnotatorTests/testDict.xml Thu Nov 22 08:24:37 2007
@@ -0,0 +1,40 @@
+<?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.
+-->
+<dictionary xmlns="http://incubator.apache.org/uima" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="dictionary.xsd">
+ <typeCollection>
+ <dictionaryMetaData caseNormalization="true" multiWordEntries="false"/>
+ <languageId>en</languageId>
+ <typeDescription>
+ <typeName>org.apache.uima.DictionaryEntry</typeName>
+ </typeDescription>
+ <entries>
+ <entry>
+ <key>new</key>
+ </entry>
+ <entry>
+ <key>new York</key>
+ </entry>
+ <entry>
+ <key>new york city</key>
+ </entry>
+ </entries>
+ </typeCollection>
+</dictionary>
\ No newline at end of file
Added: incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryBuilderTests/DictionaryPrintingRef.txt
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryBuilderTests/DictionaryPrintingRef.txt?rev=597449&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryBuilderTests/DictionaryPrintingRef.txt (added)
+++ incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryBuilderTests/DictionaryPrintingRef.txt Thu Nov 22 08:24:37 2007
@@ -0,0 +1,4 @@
+new hampshire
+new york
+new york city
+new orleans
Added: incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryBuilderTests/InvalidDictFile.xml
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryBuilderTests/InvalidDictFile.xml?rev=597449&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryBuilderTests/InvalidDictFile.xml (added)
+++ incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryBuilderTests/InvalidDictFile.xml Thu Nov 22 08:24:37 2007
@@ -0,0 +1,34 @@
+<?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.
+-->
+<dictionary xmlns="http://incubator.apache.org/uima" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="dictionary.xsd">
+ <typeCollection>
+ <dictionaryMetaData caseNormalization="true" multiWordEntries="true"/>
+ <typeDescription>
+ <typeName>org.apache.uima.DictionaryEntry</typeName>
+ </typeDescription>
+ <entries>
+ <entry>
+ <key>New Hampshire</key>
+ <key>test</key>
+ </entry>
+ </entries>
+ </typeCollection>
+</dictionary>
Added: incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryBuilderTests/InvalidDictFile2.xml
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryBuilderTests/InvalidDictFile2.xml?rev=597449&view=auto
==============================================================================
--- incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryBuilderTests/InvalidDictFile2.xml (added)
+++ incubator/uima/sandbox/trunk/DictionaryAnnotator/src/test/resources/DictionaryBuilderTests/InvalidDictFile2.xml Thu Nov 22 08:24:37 2007
@@ -0,0 +1,34 @@
+<?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.
+-->
+<dictionary xmlns="http://incubator.apache.org/uima" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="dictionary.xsd">
+ <typeCollection>
+ <dictionaryMetaData caseNormalization="true" multiWordEntries="true"/>
+ <typeDescription>
+ <typeName>org.apache.uima.DictionaryEntry</typeName>
+ </typeDescription>
+ <entries>
+ <entry>
+ <entry>
+ <key>New Hampshire</key>
+ </entry>
+ </entries>
+ </typeCollection>
+</dictionary>