From 453ca8bf904635f41b6df763684473a143e43f0f Mon Sep 17 00:00:00 2001 From: Richard Eckart de Castilho Date: Wed, 16 Oct 2019 09:07:55 +0200 Subject: [PATCH] #1418 - Support TEI XML P4 - Separate reader/writer for the moment, but doesn't mean it has to stay this way - the code is highly identical! --- .../org/dkpro/core/io/tei/TeiP4Reader.java | 732 ++++++++++++++++++ .../org/dkpro/core/io/tei/TeiP4Writer.java | 334 ++++++++ .../core/io/tei/internal/TeiP4Constants.java | 127 +++ .../core/io/tei/TeiP4ReaderWriterTest.java | 45 ++ .../src/test/resources/tei_p4/LICENSE.txt | 437 +++++++++++ .../test/resources/tei_p4/OBC2-17900417.xml | 309 ++++++++ .../tei_p4/OBC2-17900417_reference.xml | 306 ++++++++ .../src/test/resources/tei_p4/README.html | 8 + 8 files changed, 2298 insertions(+) create mode 100644 dkpro-core-io-tei-asl/src/main/java/org/dkpro/core/io/tei/TeiP4Reader.java create mode 100644 dkpro-core-io-tei-asl/src/main/java/org/dkpro/core/io/tei/TeiP4Writer.java create mode 100644 dkpro-core-io-tei-asl/src/main/java/org/dkpro/core/io/tei/internal/TeiP4Constants.java create mode 100644 dkpro-core-io-tei-asl/src/test/java/org/dkpro/core/io/tei/TeiP4ReaderWriterTest.java create mode 100644 dkpro-core-io-tei-asl/src/test/resources/tei_p4/LICENSE.txt create mode 100644 dkpro-core-io-tei-asl/src/test/resources/tei_p4/OBC2-17900417.xml create mode 100644 dkpro-core-io-tei-asl/src/test/resources/tei_p4/OBC2-17900417_reference.xml create mode 100644 dkpro-core-io-tei-asl/src/test/resources/tei_p4/README.html diff --git a/dkpro-core-io-tei-asl/src/main/java/org/dkpro/core/io/tei/TeiP4Reader.java b/dkpro-core-io-tei-asl/src/main/java/org/dkpro/core/io/tei/TeiP4Reader.java new file mode 100644 index 0000000000..dbc9615417 --- /dev/null +++ b/dkpro-core-io-tei-asl/src/main/java/org/dkpro/core/io/tei/TeiP4Reader.java @@ -0,0 +1,732 @@ +/* + * Copyright 2019 + * Ubiquitous Knowledge Processing (UKP) Lab + * Technische Universität Darmstadt + * + * Licensed 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.dkpro.core.io.tei; + +import static java.util.Arrays.asList; +import static org.apache.commons.io.IOUtils.closeQuietly; +import static org.apache.commons.lang3.StringUtils.isNotBlank; +import static org.dkpro.core.api.resources.MappingProviderFactory.createPosMappingProvider; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.ATTR_FUNCTION; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.ATTR_LEMMA; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.ATTR_POS; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.ATTR_TYPE; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.TAG_CHARACTER; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.TAG_MULTIWORD; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.TAG_PARAGRAPH; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.TAG_PERS_NAME; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.TAG_PHRASE; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.TAG_RS; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.TAG_SUNIT; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.TAG_TEI_DOC; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.TAG_TEXT; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.TAG_TITLE; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.TAG_U; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.TAG_WORD; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.Stack; +import java.util.zip.GZIPInputStream; + +import org.apache.commons.io.FilenameUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.uima.UimaContext; +import org.apache.uima.analysis_engine.AnalysisEngineProcessException; +import org.apache.uima.cas.CAS; +import org.apache.uima.cas.CASException; +import org.apache.uima.cas.Type; +import org.apache.uima.collection.CollectionException; +import org.apache.uima.fit.descriptor.ConfigurationParameter; +import org.apache.uima.fit.descriptor.MimeTypeCapability; +import org.apache.uima.fit.descriptor.ResourceMetaData; +import org.apache.uima.fit.descriptor.TypeCapability; +import org.apache.uima.fit.util.FSCollectionFactory; +import org.apache.uima.jcas.JCas; +import org.apache.uima.jcas.tcas.Annotation; +import org.apache.uima.resource.ResourceInitializationException; +import org.apache.uima.util.Logger; +import org.dkpro.core.api.io.ResourceCollectionReaderBase; +import org.dkpro.core.api.lexmorph.pos.POSUtils; +import org.dkpro.core.api.parameter.ComponentParameters; +import org.dkpro.core.api.parameter.MimeTypes; +import org.dkpro.core.api.resources.MappingProvider; +import org.dom4j.Document; +import org.dom4j.DocumentException; +import org.dom4j.Element; +import org.dom4j.io.SAXReader; +import org.dom4j.io.SAXWriter; +import org.jaxen.JaxenException; +import org.jaxen.XPath; +import org.jaxen.dom4j.Dom4jXPath; +import org.xml.sax.Attributes; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +import de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos.POS; +import de.tudarmstadt.ukp.dkpro.core.api.metadata.type.DocumentMetaData; +import de.tudarmstadt.ukp.dkpro.core.api.ner.type.NamedEntity; +import de.tudarmstadt.ukp.dkpro.core.api.segmentation.TrimUtils; +import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Lemma; +import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Paragraph; +import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Sentence; +import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token; +import de.tudarmstadt.ukp.dkpro.core.api.syntax.type.constituent.Constituent; +import de.tudarmstadt.ukp.dkpro.core.api.syntax.type.constituent.ROOT; +import eu.openminted.share.annotations.api.DocumentationResource; + +/** + * Reader for the TEI P4 XML. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Supported TEI XML elements and attributes
ElementDescriptionDKPro Core typeAttribute mappings
TEIdocument boundarygetNext(...) returns one TEI document at a time
titledocument titleDocumentMetaData
ss-unitSentence
uutteranceSentence
pparagraphParagraph
rsreferencing stringNamedEntitytype -> value
phrphraseConstituenttype -> constituentType, function -> syntacticFunction
wwordToken(pos, type) -> POS.PosValue (pos preferred over + * type)
mwmulti-wordTokensame as for w
ccharacterTokensame as for w
+ */ +@ResourceMetaData(name = "TEI P4 XML Reader") +@DocumentationResource("${docbase}/format-reference.html#format-${command}") +@MimeTypeCapability({MimeTypes.APPLICATION_TEI_XML}) +@TypeCapability( + outputs = { + "de.tudarmstadt.ukp.dkpro.core.api.metadata.type.DocumentMetaData", + "de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Paragraph", + "de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Sentence", + "de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token", + "de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Lemma", + "de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos.POS", + "de.tudarmstadt.ukp.dkpro.core.api.syntax.type.constituent.Constituent", + "de.tudarmstadt.ukp.dkpro.core.api.ner.type.NamedEntity"}) +public class TeiP4Reader + extends ResourceCollectionReaderBase +{ + /** + * Write token annotations to the CAS. + */ + public static final String PARAM_READ_TOKEN = ComponentParameters.PARAM_READ_TOKEN; + @ConfigurationParameter(name = PARAM_READ_TOKEN, mandatory = true, defaultValue = "true") + private boolean readToken; + + /** + * Write part-of-speech annotations to the CAS. + */ + public static final String PARAM_READ_POS = ComponentParameters.PARAM_READ_POS; + @ConfigurationParameter(name = PARAM_READ_POS, mandatory = true, defaultValue = "true") + private boolean readPOS; + + /** + * Write lemma annotations to the CAS. + */ + public static final String PARAM_READ_LEMMA = ComponentParameters.PARAM_READ_LEMMA; + @ConfigurationParameter(name = PARAM_READ_LEMMA, mandatory = true, defaultValue = "true") + private boolean readLemma; + + /** + * Write sentence annotations to the CAS. + */ + public static final String PARAM_READ_SENTENCE = ComponentParameters.PARAM_READ_SENTENCE; + @ConfigurationParameter(name = PARAM_READ_SENTENCE, mandatory = true, defaultValue = "true") + private boolean readSentence; + + /** + * Write constituent annotations to the CAS. + */ + public static final String PARAM_READ_CONSTITUENT = ComponentParameters.PARAM_READ_CONSTITUENT; + @ConfigurationParameter(name = PARAM_READ_CONSTITUENT, mandatory = true, defaultValue = "true") + private boolean readConstituent; + + /** + * Write named entity annotations to the CAS. + */ + public static final String PARAM_READ_NAMED_ENTITY = + ComponentParameters.PARAM_READ_NAMED_ENTITY; + @ConfigurationParameter(name = PARAM_READ_NAMED_ENTITY, mandatory = true, defaultValue = "true") + private boolean readNamedEntity; + + /** + * Write paragraphs annotations to the CAS. + */ + public static final String PARAM_READ_PARAGRAPH = "readParagraph"; + @ConfigurationParameter(name = PARAM_READ_PARAGRAPH, mandatory = true, defaultValue = "true") + private boolean readParagraph; + + /** + * Use the xml:id attribute on the TEI elements as document ID. Mind that many TEI files + * may not have this attribute on all TEI elements and you may end up with no document ID + * at all. Also mind that the IDs should be unique. + */ + public static final String PARAM_USE_XML_ID = "useXmlId"; + @ConfigurationParameter(name = PARAM_USE_XML_ID, mandatory = true, defaultValue = "false") + private boolean useXmlId; + + /** + * When not using the XML ID, use only the filename instead of the whole URL as ID. Mind that + * the filenames should be unique in this case. + */ + public static final String PARAM_USE_FILENAME_ID = "useFilenameId"; + @ConfigurationParameter(name = PARAM_USE_FILENAME_ID, mandatory = true, defaultValue = "false") + private boolean useFilenameId; + + /** + * Do not write ignoreable whitespace from the XML file to the CAS. + */ + // REC: This does not seem to work. Maybe because SAXWriter does not generate this event? + public static final String PARAM_OMIT_IGNORABLE_WHITESPACE = "omitIgnorableWhitespace"; + @ConfigurationParameter(name = PARAM_OMIT_IGNORABLE_WHITESPACE, mandatory = true, defaultValue = "false") + private boolean omitIgnorableWhitespace; + + /** + * Enable/disable type mapping. + */ + public static final String PARAM_MAPPING_ENABLED = ComponentParameters.PARAM_MAPPING_ENABLED; + @ConfigurationParameter(name = PARAM_MAPPING_ENABLED, mandatory = true, defaultValue = + ComponentParameters.DEFAULT_MAPPING_ENABLED) + protected boolean mappingEnabled; + + /** + * Location of the mapping file for part-of-speech tags to UIMA types. + */ + public static final String PARAM_POS_MAPPING_LOCATION = + ComponentParameters.PARAM_POS_MAPPING_LOCATION; + @ConfigurationParameter(name = PARAM_POS_MAPPING_LOCATION, mandatory = false) + protected String mappingPosLocation; + + /** + * Use this part-of-speech tag set to use to resolve the tag set mapping instead of using the + * tag set defined as part of the model meta data. This can be useful if a custom model is + * specified which does not have such meta data, or it can be used in readers. + */ + public static final String PARAM_POS_TAG_SET = ComponentParameters.PARAM_POS_TAG_SET; + @ConfigurationParameter(name = PARAM_POS_TAG_SET, mandatory = false) + protected String posTagset; + + /** + * Interpret utterances "u" as sentenes "s". (EXPERIMENTAL) + */ + public static final String PARAM_UTTERANCES_AS_SENTENCES = "utterancesAsSentences"; + @ConfigurationParameter(name = PARAM_UTTERANCES_AS_SENTENCES, mandatory = true, defaultValue = "false") + private boolean utterancesAsSentences; + + /** + * Trim the given elements (remote leading and trailing whitespace). DKPro Core usually expects + * annotations to start and end at a non-whitespace character. + */ + public static final String PARAM_ELEMENTS_TO_TRIM = "elementsToTrim"; + @ConfigurationParameter(name = PARAM_ELEMENTS_TO_TRIM, mandatory = true, defaultValue = { + TAG_SUNIT, TAG_U, TAG_PARAGRAPH, TAG_RS, TAG_WORD, TAG_CHARACTER, TAG_MULTIWORD}) + private Set elementsToTrim; + + private Iterator teiElementIterator; + private Element currentTeiElement; + private Resource currentResource; + private int currentTeiElementNumber; + + private MappingProvider posMappingProvider; + + @Override + public void initialize(UimaContext aContext) + throws ResourceInitializationException + { + super.initialize(aContext); + + if (readPOS && !readToken) { + throw new ResourceInitializationException(new IllegalArgumentException( + "Setting readPOS to 'true' requires writeToken to be 'true' too.")); + } + + try { + // Init with an empty iterator + teiElementIterator = asList(new Element[0]).iterator(); + + // Make sure we know about the first element; + nextTeiElement(); + } + catch (CollectionException | IOException e) { + throw new ResourceInitializationException(e); + } + + posMappingProvider = createPosMappingProvider(this, mappingPosLocation, posTagset, + getLanguage()); + } + + private void nextTeiElement() throws CollectionException, IOException + { + if (teiElementIterator == null) { + currentTeiElement = null; + return; + } + + while (!teiElementIterator.hasNext() && super.hasNext()) { + currentResource = nextFile(); + + InputStream is = null; + try { + is = currentResource.getInputStream(); + + if (currentResource.getPath().endsWith(".gz")) { + is = new GZIPInputStream(is); + } + + InputSource source = new InputSource(is); + source.setPublicId(currentResource.getLocation()); + source.setSystemId(currentResource.getLocation()); + + SAXReader reader = new SAXReader(); + Document xml = reader.read(source); + + final XPath teiPath = new Dom4jXPath("//TEI.2"); + + List teiElements = teiPath.selectNodes(xml); + +// System.out.printf("Found %d TEI elements in %s.%n", teiElements.size(), +// currentResource.getLocation()); + + teiElementIterator = teiElements.iterator(); + currentTeiElementNumber = 0; + } + catch (DocumentException e) { + throw new IOException(e); + } + catch (JaxenException e) { + throw new IOException(e); + } + finally { + closeQuietly(is); + } + } + + currentTeiElement = teiElementIterator.hasNext() ? teiElementIterator.next() : null; + currentTeiElementNumber++; + + if (!super.hasNext() && !teiElementIterator.hasNext()) { + // Mark end of processing. + teiElementIterator = null; + } + } + + @Override + public boolean hasNext() + throws IOException, CollectionException + { + return teiElementIterator != null || currentTeiElement != null; + } + + @Override + public void getNext(CAS aCAS) + throws IOException, CollectionException + { + initCas(aCAS, currentResource); + + // Set up language + if (getConfigParameterValue(PARAM_LANGUAGE) != null) { + aCAS.setDocumentLanguage((String) getConfigParameterValue(PARAM_LANGUAGE)); + } + + // Configure mapping only now, because now the language is set in the CAS + try { + posMappingProvider.configure(aCAS); + } + catch (AnalysisEngineProcessException e1) { + throw new IOException(e1); + } + + InputStream is = null; + + try { + JCas jcas = aCAS.getJCas(); + + // Create handler + Handler handler = newSaxHandler(); + handler.setJCas(jcas); + handler.setLogger(getLogger()); + + // Parse TEI text + SAXWriter writer = new SAXWriter(handler); + writer.write(currentTeiElement); + handler.endDocument(); + } + catch (CASException e) { + throw new CollectionException(e); + } + catch (SAXException e) { + throw new IOException(e); + } + finally { + closeQuietly(is); + } + + // Move currentTeiElement to the next text + nextTeiElement(); + } + + protected Handler newSaxHandler() + { + return new TeiHandler(); + } + + protected abstract static class Handler + extends DefaultHandler + { + private JCas jcas; + private Logger logger; + + public void setJCas(final JCas aJCas) + { + jcas = aJCas; + } + + protected JCas getJCas() + { + return jcas; + } + + public void setLogger(Logger aLogger) + { + logger = aLogger; + } + + public Logger getLogger() + { + return logger; + } + } + + public class TeiHandler + extends Handler + { + private String documentId = null; + private boolean titleSet = false; + private boolean inTextElement = false; + private boolean captureText = false; + private int paragraphStart = -1; + private int sentenceStart = -1; + private int tokenStart = -1; + private String posTag = null; + private String lemma = null; + private Stack constituents = new Stack<>(); + private Stack namedEntities = new Stack<>(); + + private final StringBuilder buffer = new StringBuilder(); + + @Override + public void endDocument() + throws SAXException + { + getJCas().setDocumentText(buffer.toString()); + } + + protected StringBuilder getBuffer() + { + return buffer; + } + + @Override + public void startElement(String aUri, String aLocalName, String aName, + Attributes aAttributes) + throws SAXException + { +// System.out.printf("%b START %s %n", captureText, aLocalName); + if (!inTextElement && TAG_TEI_DOC.equals(aName)) { + if (useXmlId) { + documentId = aAttributes.getValue("xml:id"); + } + else if (useFilenameId) { + documentId = FilenameUtils.getName(currentResource.getPath()) + "#" + + currentTeiElementNumber; + } + else { + documentId = currentResource.getPath() + "#" + currentTeiElementNumber; + } + } + else if (!inTextElement && TAG_TITLE.equals(aName)) { + captureText = true; + } + else if (TAG_TEXT.equals(aName)) { + captureText = true; + inTextElement = true; + } + else if (inTextElement && (TAG_SUNIT.equals(aName) || + (utterancesAsSentences && TAG_U.equals(aName)))) { + sentenceStart = getBuffer().length(); + } + else if (inTextElement && TAG_PARAGRAPH.equals(aName)) { + if (paragraphStart != -1) { + throw new SAXException("Nested paragraphs are not supported"); + } + paragraphStart = getBuffer().length(); + } + else if (readNamedEntity && inTextElement && TAG_RS.equals(aName)) { + NamedEntity ne = new NamedEntity(getJCas()); + ne.setBegin(getBuffer().length()); + ne.setValue(aAttributes.getValue(ATTR_TYPE)); + namedEntities.push(ne); + } + else if (readNamedEntity && inTextElement && TAG_PERS_NAME.equals(aName)) { + NamedEntity ne = new NamedEntity(getJCas()); + ne.setBegin(getBuffer().length()); + ne.setValue("PER"); + namedEntities.push(ne); + } + else if (readConstituent && inTextElement && TAG_PHRASE.equals(aName)) { + if (constituents.isEmpty()) { + ROOT root = new ROOT(getJCas()); + root.setConstituentType("ROOT"); + constituents.push(new ConstituentWrapper(root)); + } + + Constituent constituent = new Constituent(getJCas()); + constituent.setConstituentType(aAttributes.getValue(ATTR_TYPE)); + constituent.setSyntacticFunction(aAttributes.getValue(ATTR_FUNCTION)); + constituents.push(new ConstituentWrapper(constituent)); + } + else if (inTextElement + && (TAG_WORD.equals(aName) || TAG_CHARACTER.equals(aName) || TAG_MULTIWORD + .equals(aName))) { + tokenStart = getBuffer().length(); + if (StringUtils.isNotEmpty(aAttributes.getValue(ATTR_POS))) { + posTag = aAttributes.getValue(ATTR_POS); + } + else { + posTag = aAttributes.getValue(ATTR_TYPE); + } + lemma = aAttributes.getValue(ATTR_LEMMA); + } + } + + @Override + public void endElement(String aUri, String aLocalName, String aName) + throws SAXException + { +// System.out.printf("%b END %s %n", captureText, aLocalName); + if (!inTextElement && TAG_TITLE.equals(aName)) { + DocumentMetaData meta = DocumentMetaData.get(getJCas()); + // Read only the first title and hope it is the main title + if (!titleSet) { + meta.setDocumentTitle(getBuffer().toString().trim()); + titleSet = true; + } + meta.setDocumentId(documentId); + getBuffer().setLength(0); + captureText = false; + } + else if (TAG_TEXT.equals(aName)) { + captureText = false; + inTextElement = false; + } + else if (inTextElement && (TAG_SUNIT.equals(aName) || + (utterancesAsSentences && TAG_U.equals(aName)))) { + if (readSentence) { + Sentence s = new Sentence(getJCas(), sentenceStart, getBuffer().length()); + if (elementsToTrim.contains(aName)) { + TrimUtils.trim(getBuffer(), s); + } + s.addToIndexes(); + } + sentenceStart = -1; + } + else if (inTextElement && TAG_PARAGRAPH.equals(aName)) { + if (readParagraph) { + Paragraph para = new Paragraph(getJCas(), paragraphStart, getBuffer().length()); + if (elementsToTrim.contains(aName)) { + TrimUtils.trim(getBuffer(), para); + } + para.addToIndexes(); + } + paragraphStart = -1; + } + else if (readNamedEntity && inTextElement && TAG_RS.equals(aName)) { + NamedEntity ne = namedEntities.pop(); + ne.setEnd(getBuffer().length()); + if (elementsToTrim.contains(aName)) { + TrimUtils.trim(getBuffer(), ne); + } + ne.addToIndexes(); + } + else if (readNamedEntity && inTextElement && TAG_PERS_NAME.equals(aName)) { + NamedEntity ne = namedEntities.pop(); + ne.setEnd(getBuffer().length()); + if (elementsToTrim.contains(aName)) { + TrimUtils.trim(getBuffer(), ne); + } + ne.addToIndexes(); + } + else if (readConstituent && inTextElement && TAG_PHRASE.equals(aName)) { + ConstituentWrapper wrapper = constituents.pop(); + wrapper.constituent.setBegin(wrapper.children.get(0).getBegin()); + wrapper.constituent + .setEnd(wrapper.children.get(wrapper.children.size() - 1).getEnd()); + if (!constituents.isEmpty()) { + ConstituentWrapper parent = constituents.peek(); + wrapper.constituent.setParent(parent.constituent); + parent.children.add(wrapper.constituent); + } + wrapper.constituent.setChildren(FSCollectionFactory.createFSArray(getJCas(), + wrapper.children)); + wrapper.constituent.addToIndexes(); + + // Close off the ROOT + if (constituents.peek().constituent instanceof ROOT) { + ConstituentWrapper rootWrapper = constituents.pop(); + rootWrapper.constituent.setBegin(wrapper.children.get(0).getBegin()); + rootWrapper.constituent + .setEnd(wrapper.children.get(wrapper.children.size() - 1).getEnd()); + rootWrapper.constituent.setChildren(FSCollectionFactory.createFSArray( + getJCas(), rootWrapper.children)); + rootWrapper.constituent.addToIndexes(); + } + } + else if (inTextElement + && (TAG_WORD.equals(aName) || TAG_CHARACTER.equals(aName) || TAG_MULTIWORD + .equals(aName))) { + if (isNotBlank(getBuffer().substring(tokenStart, getBuffer().length()))) { + Token token = new Token(getJCas(), tokenStart, getBuffer().length()); + + if (elementsToTrim.contains(aName)) { + TrimUtils.trim(getBuffer(), token); + } + + if (posTag != null && readPOS) { + Type posTagType = posMappingProvider.getTagType(posTag); + POS pos = (POS) getJCas().getCas().createAnnotation(posTagType, + token.getBegin(), token.getEnd()); + pos.setPosValue(posTag); + POSUtils.assignCoarseValue(pos); + pos.addToIndexes(); + token.setPos(pos); + } + + if (lemma != null && readLemma) { + Lemma l = new Lemma(getJCas(), token.getBegin(), token.getEnd()); + l.setValue(lemma); + l.addToIndexes(); + token.setLemma(l); + } + + // FIXME: if readToken is disabled, the JCas wrapper should not be generated + // at all! + if (readToken) { + if (!constituents.isEmpty()) { + ConstituentWrapper parent = constituents.peek(); + token.setParent(parent.constituent); + parent.children.add(token); + } + + token.addToIndexes(); + } + } + + tokenStart = -1; + } + } + + @Override + public void characters(char[] aCh, int aStart, int aLength) + throws SAXException + { + if (captureText) { + buffer.append(aCh, aStart, aLength); + } + } + + @Override + public void ignorableWhitespace(char[] aCh, int aStart, int aLength) + throws SAXException + { + if (captureText && !omitIgnorableWhitespace) { + buffer.append(aCh, aStart, aLength); + } + } + } + + private static class ConstituentWrapper { + public Constituent constituent; + public List children = new ArrayList(); + + public ConstituentWrapper(Constituent aConstituent) + { + constituent = aConstituent; + } + } +} diff --git a/dkpro-core-io-tei-asl/src/main/java/org/dkpro/core/io/tei/TeiP4Writer.java b/dkpro-core-io-tei-asl/src/main/java/org/dkpro/core/io/tei/TeiP4Writer.java new file mode 100644 index 0000000000..c2fb6fbe70 --- /dev/null +++ b/dkpro-core-io-tei-asl/src/main/java/org/dkpro/core/io/tei/TeiP4Writer.java @@ -0,0 +1,334 @@ +/* + * Copyright 2017 + * Ubiquitous Knowledge Processing (UKP) Lab + * Technische Universität Darmstadt + * + * Licensed 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.dkpro.core.io.tei; + +import static org.apache.commons.io.IOUtils.closeQuietly; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.ATTR_FUNCTION; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.ATTR_LEMMA; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.ATTR_TYPE; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.E_TEI_BODY; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.E_TEI_FILE_DESC; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.E_TEI_HEADER; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.E_TEI_TEI; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.E_TEI_TEXT; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.E_TEI_TITLE; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.E_TEI_TITLE_STMT; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.TAG_CHARACTER; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.TAG_PARAGRAPH; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.TAG_PHRASE; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.TAG_RS; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.TAG_SUNIT; +import static org.dkpro.core.io.tei.internal.TeiP4Constants.TAG_WORD; + +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import java.util.Stack; +import java.util.regex.Pattern; + +import javax.xml.namespace.QName; +import javax.xml.stream.XMLEventFactory; +import javax.xml.stream.XMLEventWriter; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.events.Attribute; + +import org.apache.uima.analysis_engine.AnalysisEngineProcessException; +import org.apache.uima.cas.FSIterator; +import org.apache.uima.fit.descriptor.ConfigurationParameter; +import org.apache.uima.fit.descriptor.MimeTypeCapability; +import org.apache.uima.fit.descriptor.ResourceMetaData; +import org.apache.uima.fit.descriptor.TypeCapability; +import org.apache.uima.jcas.JCas; +import org.apache.uima.jcas.tcas.Annotation; +import org.dkpro.core.api.io.JCasFileWriter_ImplBase; +import org.dkpro.core.api.parameter.ComponentParameters; +import org.dkpro.core.api.parameter.MimeTypes; + +import de.tudarmstadt.ukp.dkpro.core.api.metadata.type.DocumentMetaData; +import de.tudarmstadt.ukp.dkpro.core.api.ner.type.NamedEntity; +import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Paragraph; +import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Sentence; +import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token; +import de.tudarmstadt.ukp.dkpro.core.api.syntax.type.constituent.Constituent; +import de.tudarmstadt.ukp.dkpro.core.api.syntax.type.constituent.ROOT; +import eu.openminted.share.annotations.api.DocumentationResource; +import javanet.staxutils.IndentingXMLEventWriter; + +/** + * UIMA CAS consumer writing the CAS document text in TEI format. + */ +@ResourceMetaData(name = "TEI P4 XML Writer") +@DocumentationResource("${docbase}/format-reference.html#format-${command}") +@MimeTypeCapability({MimeTypes.APPLICATION_TEI_XML}) +@TypeCapability( + inputs = { + "de.tudarmstadt.ukp.dkpro.core.api.metadata.type.DocumentMetaData", + "de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Paragraph", + "de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Sentence", + "de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token", + "de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos.POS", + "de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Lemma", + "de.tudarmstadt.ukp.dkpro.core.api.syntax.type.constituent.Constituent", + "de.tudarmstadt.ukp.dkpro.core.api.ner.type.NamedEntity"}) +public class TeiP4Writer + extends JCasFileWriter_ImplBase +{ + /** + * Specify the suffix of output files. Default value .xml. If the suffix is not + * needed, provide an empty string as value. + */ + public static final String PARAM_FILENAME_EXTENSION = + ComponentParameters.PARAM_FILENAME_EXTENSION; + @ConfigurationParameter(name = PARAM_FILENAME_EXTENSION, mandatory = true, defaultValue = ".xml") + private String filenameSuffix; + + /** + * A token matching this pattern is rendered as a TEI "c" element instead of a "w" element. + */ + public static final String PARAM_C_TEXT_PATTERN = "cTextPattern"; + @ConfigurationParameter(name = PARAM_C_TEXT_PATTERN, mandatory = true, defaultValue = "[,.:;()]|(``)|('')|(--)") + private Pattern cTextPattern; + + /** + * Write constituent annotations to the CAS. Disabled by default because it requires type + * priorities to be set up (Constituents must have a higher prio than Tokens). + */ + public static final String PARAM_WRITE_CONSTITUENT = + ComponentParameters.PARAM_WRITE_CONSTITUENT; + @ConfigurationParameter(name = PARAM_WRITE_CONSTITUENT, mandatory = true, defaultValue = "false") + private boolean writeConstituent; + + /** + * Write named entity annotations to the CAS. Overlapping named entities are not supported. + */ + public static final String PARAM_WRITE_NAMED_ENTITY = + ComponentParameters.PARAM_WRITE_NAMED_ENTITY; + @ConfigurationParameter(name = PARAM_WRITE_NAMED_ENTITY, mandatory = true, defaultValue = "true") + private boolean writeNamedEntity; + + /** + * Indent the XML. + */ + public static final String PARAM_INDENT = "indent"; + @ConfigurationParameter(name = PARAM_INDENT, mandatory = true, defaultValue = "false") + private boolean indent; + + private final XMLEventFactory xmlef = XMLEventFactory.newInstance(); + + @Override + public void process(JCas aJCas) + throws AnalysisEngineProcessException + { + String text = aJCas.getDocumentText(); + + OutputStream docOS = null; + XMLEventWriter xmlEventWriter = null; + try { + docOS = getOutputStream(aJCas, filenameSuffix); + + XMLOutputFactory xmlOutputFactory = XMLOutputFactory.newInstance(); + xmlOutputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, true); + + xmlEventWriter = xmlOutputFactory.createXMLEventWriter(docOS, "UTF-8"); + if (indent) { + xmlEventWriter = new IndentingXMLEventWriter(xmlEventWriter); + } + + xmlEventWriter.add(xmlef.createStartDocument()); + xmlEventWriter.add(xmlef.createStartElement(E_TEI_TEI, null, null)); + + // Render header + DocumentMetaData meta = DocumentMetaData.get(aJCas); + xmlEventWriter.add(xmlef.createStartElement(E_TEI_HEADER, null, null)); + xmlEventWriter.add(xmlef.createStartElement(E_TEI_FILE_DESC, null, null)); + xmlEventWriter.add(xmlef.createStartElement(E_TEI_TITLE_STMT, null, null)); + xmlEventWriter.add(xmlef.createStartElement(E_TEI_TITLE, null, null)); + xmlEventWriter.add(xmlef.createCharacters(meta.getDocumentTitle())); + xmlEventWriter.add(xmlef.createEndElement(E_TEI_TITLE, null)); + xmlEventWriter.add(xmlef.createEndElement(E_TEI_TITLE_STMT, null)); + xmlEventWriter.add(xmlef.createEndElement(E_TEI_FILE_DESC, null)); + xmlEventWriter.add(xmlef.createEndElement(E_TEI_HEADER, null)); + + // Render text + xmlEventWriter.add(xmlef.createStartElement(E_TEI_TEXT, null, null)); + xmlEventWriter.add(xmlef.createStartElement(E_TEI_BODY, null, null)); + + FSIterator iterator = aJCas.getAnnotationIndex().iterator(); + + Stack stack = new Stack(); + int pos = 0; + Annotation cur = null; + + while (iterator.isValid()) { + Annotation nextAnnot = iterator.get(); + + // Ignore unmapped elements + Optional teiElement = getTeiTag(nextAnnot); + if (!teiElement.isPresent()) { + iterator.moveToNext(); + continue; + } + + // Check if next annotation is potentially nested + if (cur == null || nextAnnot.getBegin() < cur.getEnd()) { + // Check if next annotation is fully nested + if (cur == null || nextAnnot.getEnd() <= cur.getEnd()) { + // Text between current and next annotation + xmlEventWriter.add(xmlef.createCharacters(text.substring(pos, + nextAnnot.getBegin()))); + // Next annotation + xmlEventWriter + .add(xmlef.createStartElement(new QName(teiElement.get()), + getAttributes(nextAnnot), null)); + + stack.push(cur); + cur = nextAnnot; + pos = nextAnnot.getBegin(); + } + else { + // Overlapping annotations are ignored + getLogger().debug("Unable to render overlapping annotation"); + } + iterator.moveToNext(); + } + // Next annotation is following, not nested + else { + // Text between current and next annotation + xmlEventWriter.add(xmlef.createCharacters(text.substring(pos, cur.getEnd()))); + xmlEventWriter + .add(xmlef.createEndElement(new QName(teiElement.get()), null)); + + pos = cur.getEnd(); + cur = stack.pop(); + } + } + + // End of text, end all elements that are still on the stack + if (cur != null) { + xmlEventWriter.add(xmlef.createCharacters(text.substring(pos, cur.getEnd()))); + pos = cur.getEnd(); + xmlEventWriter + .add(xmlef.createEndElement(new QName(getTeiTag(cur).get()), null)); + + while (!stack.isEmpty()) { + cur = stack.pop(); + if (cur == null) { + break; + } + xmlEventWriter.add(xmlef.createCharacters(text.substring(pos, cur.getEnd()))); + pos = cur.getEnd(); + xmlEventWriter.add( + xmlef.createEndElement(new QName(getTeiTag(cur).get()), null)); + } + } + + if (pos < text.length()) { + xmlEventWriter.add(xmlef.createCharacters(text.substring(pos, text.length()))); + } + + xmlEventWriter.add(xmlef.createEndElement(E_TEI_BODY, null)); + xmlEventWriter.add(xmlef.createEndElement(E_TEI_TEXT, null)); + xmlEventWriter.add(xmlef.createEndElement(E_TEI_TEI, null)); + xmlEventWriter.add(xmlef.createEndDocument()); + } + catch (Exception e) { + throw new AnalysisEngineProcessException(e); + } + finally { + if (xmlEventWriter != null) { + try { + xmlEventWriter.close(); + } + catch (XMLStreamException e) { + getLogger().warn("Error closing the XML event writer", e); + } + } + + closeQuietly(docOS); + } + } + + private Iterator getAttributes(Annotation aAnnotation) { + List attributes = new ArrayList(); + if (aAnnotation instanceof Token) { + Token t = (Token) aAnnotation; + if (t.getPos() != null) { + attributes.add(xmlef.createAttribute(ATTR_TYPE, t.getPos().getPosValue())); + } + if (t.getLemma() != null) { + attributes.add(xmlef.createAttribute(ATTR_LEMMA, t.getLemma().getValue())); + } + } + else if (aAnnotation instanceof NamedEntity) { + NamedEntity ne = (NamedEntity) aAnnotation; + attributes.add(xmlef.createAttribute(ATTR_TYPE, ne.getValue())); + } + else if (aAnnotation instanceof Constituent) { + Constituent c = (Constituent) aAnnotation; + if ("ROOT".equals(c.getConstituentType())) { + System.out.println(); + } + if (c.getConstituentType() != null) { + attributes.add(xmlef.createAttribute(ATTR_TYPE, c.getConstituentType())); + } + if (c.getSyntacticFunction() != null) { + attributes.add(xmlef.createAttribute(ATTR_FUNCTION, c.getSyntacticFunction())); + } + } + return attributes.iterator(); + } + + private Optional getTeiTag(Annotation aAnnotation) + { + if (aAnnotation instanceof Constituent) { + Constituent c = (Constituent) aAnnotation; + if ("ROOT".equals(c.getConstituentType())) { + System.out.println(); + } + } + + if (aAnnotation.getTypeIndexID() == Token.type) { + if (cTextPattern.matcher(aAnnotation.getCoveredText()).matches()) { + return Optional.of(TAG_CHARACTER); + } + return Optional.of(TAG_WORD); + } + else if (aAnnotation.getTypeIndexID() == Sentence.type) { + return Optional.of(TAG_SUNIT); + } + else if (aAnnotation.getTypeIndexID() == Paragraph.type) { + return Optional.of(TAG_PARAGRAPH); + } + else if (writeConstituent && (aAnnotation instanceof ROOT)) { + // We do not render ROOT nodes + return Optional.empty(); + } + else if (writeConstituent && (aAnnotation instanceof Constituent)) { + return Optional.of(TAG_PHRASE); + } + else if (writeNamedEntity && (aAnnotation instanceof NamedEntity)) { + return Optional.of(TAG_RS); + } + else { + return Optional.empty(); + } + } +} diff --git a/dkpro-core-io-tei-asl/src/main/java/org/dkpro/core/io/tei/internal/TeiP4Constants.java b/dkpro-core-io-tei-asl/src/main/java/org/dkpro/core/io/tei/internal/TeiP4Constants.java new file mode 100644 index 0000000000..79944ecf49 --- /dev/null +++ b/dkpro-core-io-tei-asl/src/main/java/org/dkpro/core/io/tei/internal/TeiP4Constants.java @@ -0,0 +1,127 @@ +/* + * Copyright 2019 + * Ubiquitous Knowledge Processing (UKP) Lab + * Technische Universität Darmstadt + * + * Licensed 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.dkpro.core.io.tei.internal; + +import javax.xml.namespace.QName; + +public final class TeiP4Constants +{ + /** + * (character) represents a character. + */ + public static final String TAG_CHARACTER = "c"; + + /** + * (word) represents a grammatical (not necessarily orthographic) word. + */ + public static final String TAG_WORD = "w"; + public static final String TAG_MULTIWORD = "mw"; + + /** + * (s-unit) contains a sentence-like division of a text. + */ + public static final String TAG_SUNIT = "s"; + + /** + * (utterance) a stretch of speech usually preceded and followed by silence or by a change of + * speaker. + */ + public static final String TAG_U = "u"; + + /** + * (paragraph) marks paragraphs in prose. + */ + public static final String TAG_PARAGRAPH = "p"; + + /** + * (phrase) represents a grammatical phrase. + */ + public static final String TAG_PHRASE = "phr"; + + /** + * (referencing string) contains a general purpose name or referring string. + */ + public static final String TAG_RS = "rs"; + + /** + * contains a single text of any kind, whether unitary or composite, for example a poem or + * drama, a collection of essays, a novel, a dictionary, or a corpus sample. + */ + public static final String TAG_TEXT = "text"; + + /** + * contains the title of a work, whether article, book, journal, or series, including any + * alternative titles or subtitles. + */ + public static final String TAG_TITLE = "title"; + + /** + * (TEI document) contains a single TEI-conformant document, comprising a TEI header and a text, + * either in isolation or as part of a element. + */ + public static final String TAG_TEI_DOC = "TEI.2"; + + /** + * (text body) contains the whole body of a single unitary text, excluding any front or back + * matter. + */ + public static final String TAG_BODY = "body"; + + /** + * (TEI Header) supplies the descriptive and declarative information making up an ‘electronic + * title page’ prefixed to every TEI-conformant text. + */ + public static final String TAG_TEI_HEADER = "teiHeader"; + + /** + * (File Description) contains a full bibliographic description of an electronic file. + */ + public static final String TAG_FILE_DESC = "fileDesc"; + + /** + * (title statement) groups information about the title of a work and those responsible for its + * intellectual content. + */ + public static final String TAG_TITLE_STMT = "titleStmt"; + + /** + * (personal name) contains a proper noun or proper-noun phrase referring to a person, possibly + * including any or all of the person's forenames, surnames, honorifics, added names, etc. + */ + public static final String TAG_PERS_NAME = "persName"; + + public static final String ATTR_TYPE = "type"; + public static final String ATTR_POS = "pos"; + public static final String ATTR_FUNCTION = "function"; + public static final String ATTR_LEMMA = "lemma"; + + + public static final QName E_TEI_TEI = new QName(TAG_TEI_DOC); + public static final QName E_TEI_HEADER = new QName(TAG_TEI_HEADER); + public static final QName E_TEI_FILE_DESC = new QName(TAG_FILE_DESC); + public static final QName E_TEI_TITLE_STMT = new QName(TAG_TITLE_STMT); + public static final QName E_TEI_TITLE = new QName(TAG_TITLE); + public static final QName E_TEI_TEXT = new QName(TAG_TEXT); + public static final QName E_TEI_BODY = new QName(TAG_BODY); + public static final QName E_TEI_PERS_NAME = new QName(TAG_PERS_NAME); + + private TeiP4Constants() + { + // No instances + } +} diff --git a/dkpro-core-io-tei-asl/src/test/java/org/dkpro/core/io/tei/TeiP4ReaderWriterTest.java b/dkpro-core-io-tei-asl/src/test/java/org/dkpro/core/io/tei/TeiP4ReaderWriterTest.java new file mode 100644 index 0000000000..a84951fcf8 --- /dev/null +++ b/dkpro-core-io-tei-asl/src/test/java/org/dkpro/core/io/tei/TeiP4ReaderWriterTest.java @@ -0,0 +1,45 @@ +/* + * Copyright 2017 + * Ubiquitous Knowledge Processing (UKP) Lab + * Technische Universität Darmstadt + * + * Licensed 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.dkpro.core.io.tei; + +import static java.util.Collections.emptyList; +import static org.apache.uima.fit.factory.AnalysisEngineFactory.createEngineDescription; +import static org.apache.uima.fit.factory.CollectionReaderFactory.createReaderDescription; +import static org.dkpro.core.testing.IOTestRunner.testOneWay; + +import org.dkpro.core.testing.DkproTestContext; +import org.junit.Rule; +import org.junit.Test; + +public class TeiP4ReaderWriterTest +{ + @Test + public void testWithoutTrim() + throws Exception + { + testOneWay( + createReaderDescription(TeiP4Reader.class, + TeiP4Reader.PARAM_ELEMENTS_TO_TRIM, emptyList()), + createEngineDescription(TeiP4Writer.class), + "tei_p4/OBC2-17900417_reference.xml", + "tei_p4/OBC2-17900417.xml"); + } + + @Rule + public DkproTestContext testContext = new DkproTestContext(); +} diff --git a/dkpro-core-io-tei-asl/src/test/resources/tei_p4/LICENSE.txt b/dkpro-core-io-tei-asl/src/test/resources/tei_p4/LICENSE.txt new file mode 100644 index 0000000000..12ff68f28d --- /dev/null +++ b/dkpro-core-io-tei-asl/src/test/resources/tei_p4/LICENSE.txt @@ -0,0 +1,437 @@ +Attribution-NonCommercial-ShareAlike 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More_considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International +Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution-NonCommercial-ShareAlike 4.0 International Public License +("Public License"). To the extent this Public License may be +interpreted as a contract, You are granted the Licensed Rights in +consideration of Your acceptance of these terms and conditions, and the +Licensor grants You such rights in consideration of benefits the +Licensor receives from making the Licensed Material available under +these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. BY-NC-SA Compatible License means a license listed at + creativecommons.org/compatiblelicenses, approved by Creative + Commons as essentially the equivalent of this Public License. + + d. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + e. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + f. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + g. License Elements means the license attributes listed in the name + of a Creative Commons Public License. The License Elements of this + Public License are Attribution, NonCommercial, and ShareAlike. + + h. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + i. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + j. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + k. NonCommercial means not primarily intended for or directed towards + commercial advantage or monetary compensation. For purposes of + this Public License, the exchange of the Licensed Material for + other material subject to Copyright and Similar Rights by digital + file-sharing or similar means is NonCommercial provided there is + no payment of monetary compensation in connection with the + exchange. + + l. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + m. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + n. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part, for NonCommercial purposes only; and + + b. produce, reproduce, and Share Adapted Material for + NonCommercial purposes only. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. Additional offer from the Licensor -- Adapted Material. + Every recipient of Adapted Material from You + automatically receives an offer from the Licensor to + exercise the Licensed Rights in the Adapted Material + under the conditions of the Adapter's License You apply. + + c. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties, including when + the Licensed Material is used other than for NonCommercial + purposes. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + b. ShareAlike. + + In addition to the conditions in Section 3(a), if You Share + Adapted Material You produce, the following conditions also apply. + + 1. The Adapter's License You apply must be a Creative Commons + license with the same License Elements, this version or + later, or a BY-NC-SA Compatible License. + + 2. You must include the text of, or the URI or hyperlink to, the + Adapter's License You apply. You may satisfy this condition + in any reasonable manner based on the medium, means, and + context in which You Share Adapted Material. + + 3. You may not offer or impose any additional or different terms + or conditions on, or apply any Effective Technological + Measures to, Adapted Material that restrict exercise of the + rights granted under the Adapter's License You apply. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database for NonCommercial purposes + only; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material, + including for purposes of Section 3(b); and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. diff --git a/dkpro-core-io-tei-asl/src/test/resources/tei_p4/OBC2-17900417.xml b/dkpro-core-io-tei-asl/src/test/resources/tei_p4/OBC2-17900417.xml new file mode 100644 index 0000000000..309303c002 --- /dev/null +++ b/dkpro-core-io-tei-asl/src/test/resources/tei_p4/OBC2-17900417.xml @@ -0,0 +1,309 @@ + + + + + + + + + + + + + + + + + + THE WHOLE PROCEEDINGS On postponing the Trial of JOHN FRITH, FOR High-Treason, On SATURDAY, APRIL 17th, 1790, At JUSTICE-HALL, in the OLD BAILEY, CONTAINING The SPEECHES of the PRISONER, The EVIDENCE of the Reverend Mr. VILLETTE, Mr. Alderman NEWMAN and others, respecting his present Insanity. +

TAKEN IN SHORT-HAND BY E. HODGSON, PROFESSOR OF SHORT-HAND; And Published by Authority.

+

NUMBER IV. PART + + I. + + + + (Of the SESSIONS PAPER.)

+

LONDON:

+

Printed for E. HODGSON (the Proprietor); And Sold by him, at his House, No. 14, White Lion Street, Islington; Sold also by + + J. + + + + WALMSLAY, No. 35, Chancery Lane; S. BLADON, No. 13, Pater-noster Row; and C. D. PIGUENIT, No. 8, Aldgate.

+

MDCCXC.

+

+ BEFORE the Right Honourable WILLIAM PICKETT, + + LORD + MAYOR + + + + + of the City of London; the Rt. Honourable + + LLOYD + Lord + + + + + KENYON, Lord Chief Justice of His Majesty's Court of King's Bench; Sir + + BEAUMONT + HOTHAM + + + + + , Knt. one of the Barons of his Majesty's Court of Exchequer; the Honourable + + JOHN + HEATH + + + + + , Esq; one of the Justices of His Majesty's Court of Common Pleas; + + JOHN + WILLIAM ROSE + + + + + , Esq; Serjeant at Law, Recorder of the said City, and others his Majesty's Justices of Oyer and Terminer of the City of London, and Justices of Gaol Delivery of Newgate, holden for the said City and County of Middlesex.

+ +

Second Middlesex Jury.

+

+ + + William + George + + + + + .

+

+ + + Dutton + Greenwood + + + + + .

+

+ + + William + Augustus Mitchell + + + + + .

+

+ + + Kains + Ford + + + + + .

+

+ + + John + Dell + + + + + .

+

+ + + William. + May + + + + + .

+

+ + + Thomas + Hill + + + + + .

+

+ + + William + Matthews + + + + + .

+

+ + + Francis + Osliffe + + + + + .

+

+ + + William + Ramsden + + + + + .

+

+ + + William + Sedcole + + + + + .

+

+ + + Laban + Tilbrooke + + + + + .

+ +

Counsel for the Crown.

+

Mr. ATTORNEY GENERAL.

+

Mr. SOLICITOR GENERAL.

+

Mr. LAW.

+

Mr. SILVESTER.

+

Counsel for the Prisoner.

+

Mr. SHEPHERD and

+

Mr. GARROW.

+
+ + + + + + + + + +

328. THE prisoner being put to the bar, the clerk began to arraign him:

+

" JOHN FRITH , you stand indicted by the name of John Frith :" when Mr. Shepherd, one of his counsel, addressed the Court as follows:

+

Mr. Shepherd. My lord, before the prisoner is arraigned, I wish to make an application. To day my friend, Mr. Garrow, and myself, are counsel for the defendant, Mr. Frith: and though we are furnished with what we think a sufficient defence, yet we should feel ourselves deficient, if while we thought so, there was other evidence that could be brought forward; and we think there is some very important evidence which might be procured before the next sessions, on behalf of Mr. Frith: on that account, we, as counsel for him, apply to the humanity of the Attorney General, to beg he would consent to the postponing this trial to the next sessions. In this case we exercise our duty as counsel: Mr. Frith is entitled to the best of our judgment: whether he will chuse to be guided that, is certainly a consideration for his own mind. Mr. Attorney General always will attend to applications of this sort; we therefore do hope that he will consent.

+

Court. This application is made on your judgment.

+

Mr. Garrow. I entirely concur with my learned friend. We certainly, as counsel, are suitors to Mr. Attorney General's humanity, that more time may be allowed for the prisoner's defence. Whether Mr. Frith himself will or will not consent, I do not know.

+

Mr. Garrow to Mr. Frith. Mr. Frith, we have been applying to the Court, or to Mr. Attorney General, to permit your trial to stand over till next sessions, upon our judgment; it appearing to us that it will be better, and your defence better arranged.

+

Prisoner. I object to it, on account of my health, being in a bad state through long confinement. I should rather meet it now: it is depriving a subject of his liberty, and endangering his health.

+

Mr. Attorney General. Notwithstanding what this unhappy gentleman has said, I am given to understand that there may be some circumstances in his situation; and likewise that he is not very well able in point of pecuniary concerns, to be so ready in the collection of materials for his defence, as many other prisoners are: therefore if my friends are of opinion that he must go to his trial now under great disadvantages, possibly arising from the last cause, as well as the other, I shall have no objection to give the gentlemen such time as will enable them to collect such evidence as they may chuse.

+

Prisoner. Then I shall make an application to some member of parliament, or the legislature. I therefore totally appeal against such power of putting off the trial any further; and whoever dares to oppose me in that respect, I will represent him to the legislature, or some member of parliament; either to General North, or some gentleman whom I have the honour of knowing.

+

Mr. Garrow. My lord, we are put into an arduous situation. But for one, I feel it to be my, duty to take upon myself, in opposition to the prisoner, for the prisoner's benefit, to pray that the Court, or rather the Attorney General, will consent to postponing this trial.

+

Court. Mr. Attorney General has conducted himself on this occasion, as he always does, exceedingly liberal and proper; and is ready to give all that indulgence that humanity calls for, because justice could not be attained without reasonable delay interposing, therefore it must stand over till next sessions.

+

Prisoner. I do not admit of it. And I shall make an application to parliament, that I have been here three months in disagreeable confinement; and the king has broke the mutual obligation between him and the subject: and the assault is of such a simple kind of manner; and what I have met with is of such a nature, that I desire to speak by way of extenuation, and to plead guilty or not guilty to the facts. I then shall make an application as being illegally detained in prison, that you will not admit a British subject to plead to the indictment: I therefore shall make an application to the legislature, that you are violating the laws of this kingdom. I will not put it in the power of the gentlemen that are employed for me to put it off.

+

Court. It is impossible for the most inattentive observer not to be aware that there may in this case be a previous enquiry necessary: such is the humanity of the law in England, that in all stages, both when the act is committed, at the time when the prisoner makes his defence, and even at the day of execution, it is important to settle what his state of mind is; and at the time he is called to plead, if there are circumstances that suggest to one's mind, that he is not in the possession of his reason, we must certainly be careful that nothing is introduced into the administration of justice, but what belongs to that administration. The justice of the law has provided a remedy in such cases; therefore I think there ought now to be an enquiry made, touching the sanity of this man at this time; whether he is in a situation of mind to say what his grounds of defence here are. I know it is untrodden ground, though it is constitutional: then get a jury together to enquire into the present state of his mind: the twelve men that are there, will do.

+

Prisoner to Mr. Garrow. I beg the favour to speak to you.

+

Mr. Garrow. By all means, Sir.

+

+ Prisoner. The privy counsel were pleased to send the king's physician to me, after I had appeared before my Lord Kenyon, on the 22d of January. I was examined at the privy counsel by Lord Camden; and they sent the king's physician to me. I made dates and memorandums of the physician's visits, likewise remarks that I spoke to him at various times; and of the apothecary's visits also: they persevered in my being in perfect health, fit to meet my trial; and I have put down the conversations.

+

Mr. Justice Heath. The jury will take notice of that.

+

The jury sworn as follows.

+

"You shall diligently enquire, and true presentment make, for, and on behalf of our sovereign lord the king, whether John Frith, the now prisoner at the bar, who stands indicted for + + + high treason + , be of sound mind and understanding, or not, and a true verdict give according: to the best of your understanding, so help you God."

+

Mr. Shepherd. Mr. Frith, you are aware that the gentlemen of the jury, that have been just worn, are going to enquire whether you are in a fit situation to plead at this time, and to be tried. Now I wish you would state to these gentlemen what reasons you have to give, to induce them to think you are, and to produce any memorandums.

+

Prisoner. I have had a physician attended me two months past. On the 22d of January, I came into these circumstances: and they were pleased to send the king's physician to examine me, whether I was perfectly in my senses: I persevered in being so, and would take no drugs from the apothecary. I begged him to attend as a friend to me, to protect me from insult, supposing there was any possibility that I could be insulted in this great prison: but if I had not been well, I would have had my own physician, Dr. Heberden, who attended my father formerly, when living: I looked upon him as a friend attending me, to prove that I was in my senses, or any thing else. I made memorandums of his visits, and the various conversations that we had together. I made memorandums likewise of letters: a letter which I wrote to Mess. Cox and Greenwood; and I have a copy of it, and one that I wrote about the 24th of February, during the time that the last sessions was here, when I thought I might be tried; I then recopied it again. I then mentioned that a disagreeable thing had happened, that General Clarke is coming home in disgrace. To hide that infamy that has happened, they wished to give it out that I was out of my senses. The agents who had immediately freed me from the inconveniences I was under, they were ordered to deny the subject the liberty of drawing on his agent on the house where he had money to answer his bills. They acknowledged me to have been perfectly in my senses at the time when I first came to England; I drew on them, and I have totally freed myself from the inconvenience I was under, from being improperly detained in the county of Cheshire. I was writing a letter of what was publickly given out concerning the subject: I then wrote to Mess. Cox, Cox and Greenwood, to beg they would send down some gentlemen here, to prove how the liberty of the subject was invaded in 1787, in June; and such letters will prove, that the 24th of last February, I was right in my mind then; and that now I recopied it again about a fortnight ago: and it went through my attorney, to Mess. Cox, Cox and Greenwood's house: that will prove the state of my mind at that period of time.

+

Mr. Garrow. Will you have the goodness, Mr. Frith, to state to the jury the circumstance that took place on your arrival at Liverpool, about the clergyman.

+

Prisoner. When I first arrived at Liverpool I perceived I had some powers like those which St. Paul had; and the sun that St. Paul gives a description of in the Testament; an extraordinary power that came down upon me, the power of Christ; in consequence of my persecution and being ill used, the public wanted to receive me as a must extraordinary kind of a man; they would have received me in any manner that I pleased; when I went to St. Thomas's church I was there surprised to hear the clergyman preach a most extraordinary sermon upon me, as if I was a God: I found my friends wanted me to support that kind of fanaticism in this country; this sermon was printed afterwards by Eyre, the printer at Warrington; when I came to London to the king concerning some military business, I told him nothing about any supernatural abilities, or the power of God; when I went to the Infirmary over Westminster-bridge, to the Asylum, I was surprised to hear General Washington's late Chaplain, Mr. Duche, he said, I remember the words he said,

+

"see him clothed in grace," pointing to me; there were some supernatural appearances at that time, therefore I could wish the privy council, when I came to England, or the Parliament, might be witnesses that I did not want to set up any kind of powers to the public; but there are such extraordinary appearances that attend me at this moment, that it is singular; and all I do daily is to make memorandums, daily to prove myself in my senses: some friends in Cheshire wanted me to set up some kind of fanaticism, some new branch of religion.

+

Mr. Garrow. Would you be so good, Mr. Frith, to\ in\ form the Court, as you have an opportunity now, of the complaint you made to me of the effect your confinement has upon you, and the pain in your ear?

+

Prisoner. In respect to the body of people, St. Paul when he was at Jerusalem, the same kind of power then came down on the public; there is both a kind of good and evil power which we are all liable to in this world; in consequence of that I feel myself in a particularly disagreeable situation in confinement; I am under a state of suffocation almost, the divine ordinances weighing so very low down that I am entirely reduced to a shadow almost, that is all to me as if it was a death seemingly, I am so in a state of confinement.

+

The Rev. Mr. VILLETTE sworn.

+

Mr. Garrow. I believe, Sir, you have had an opportunity of conversing with this gentleman since he has been in custody? - Yes.

+

State the impressions that such conversations made on your mind? - The first time I saw him I really thought from the appearance he had, that he was deranged in his mind; I took notice so to the man that had the care of him; some time after he sent for a bible; I sent him one; then we had some conversation; and he told me he had a pocket volume of that book, but that they took it from him when he was before the privy council; he said, I am much obliged to you: I went to him a few days ago; he was reading; he said, it was the Psalms; I then talked about his trial; and he then entered into such conversation as you have heard about St. Paul and Christ.

+

This conversation is not new, you have heard it before? - Yes.

+

Prisoner. I said it was when I was landed at Liverpool, and was giving a narrative.

+

Mr. Garrow. From the whole of your intercourse with him did it appear to you that he was insane? - I really thought so.

+

You think so now? - I do.

+

+ + + RICHARD + AKERMAN + + + + + , Esq. sworn.

+

You have had frequent opportunities of seeing Mr. Frith? - I have frequently seen Mr. Frith; I have been with him frequently.

+

State from the conversation you have bad with him, and his conduct on the whole, what your opinion is of the state of his mind? - It is very hard I should be called upon; I have heard such conversation as you have heard in Court.

+

Mr. Garrow. I will not trouble Mr. Akerman.

+

+ Prisoner. I have been very silent and close for many reasons, and to protect my person; I have read the Psalms, my Lord, as I had no other books.

+

Mr. Sheriff NEWMAN sworn.

+

Mr. Shepherd. Have you had any conversation with Mr. Frith since he has been in custody? - Very frequently; I went the second day after he was in Newgate; I went entirely out of curiosity; I found him a subject of great compassion: he began talking to me very deranged for the first ten minutes; I asked him why he went over to Holland? he said, he went eastward in pursuit of the light; I said, what light? he said, why you have read the scriptures? I said, yes; says he, the same light that fell upon St. Paul when he went to Damascus; I said, what brought you back? why, says he, when I got there I found the light was in the west as well as in the east. He desired to have the liberty of walking in the yard; and I consulted Mr. Akerman: and he said, there was an order concerning him. I found him every time in the same way; I was there once when Dr. Millan came down; I met him there; he for the first five minutes had doubts, but before he went away he was perfectly satisfied the prisoner was insane; I have not the least doubt, nor possibly can have a doubt; I frequently found him reading in the book of Kings, and he told me he was learning the art of war, and he should come to be a general, and he should like to understand the art of making war as the ancients did.

+

Prisoner. I do not remember speaking about that, and I made memorandums of my conversations with Mr. Newman: I never spoke about particular lights; I said, when I went over to Holland, as the ministers neglected doing their duty to me as a subject, in protecting me from the insults of the body of people; stirring up licentiousness, aiming at me; they drove me out of the kingdom; I went to Holland to shelter myself from the body of the people; but I do not remember saying any thing of following the light.

+

To Mr. Newman. Do you think it was absolute incapacity of mind, or feigned or assumed? - I believe absolutely that he is totally deranged, and not in the use of his senses for ten minutes together; every day I saw him he was so, and of that there is not a doubt; I went at different times merely to make observations.

+

Mr. Garrow. Mr. Frith, are you acquainted with Mr. Burnsell the auctioneer? - Yes; he took an extraordinary liberty in putting into the Public Advertiser, the third of February, a letter, dated the first, declaring me insane, a most extraordinary liberty; I thought it prudent to keep a copy: I have made memorandums, but they have been taken from me by Colonel Amherst, the same as Mr. Wilkes's papers were seized, a kind of alteration of the laws of the land, a kind of scheme to make a man appear insane, to totally disguise, to undo the liberty of the British subject; in fact it is such a concealed evil that I do not know where it will end.

+

Had Mr. Burnsell any ill will to you?

+

- None at all; he was only employed to hide the mutiny that those applauses of the clergymen had occasioned; he went to a person that lives with Mrs. Dowdswell, in Upper Brook-street; he had a letter, and was perhaps see'd; the clergyman declared me as a God, the body of the people as a man insane; myself applying to the King merely to get my birth again; when I went to my friend Mr. Burnsell, I spoke of no powers of God or Christ.

+

Mr. Garrow. Was that before the complaint that you was afflicted with in your ear?

+

Prisoner. Before that, the pain in my ear; shall I finish with respect to Mr. Burnsell?

+

Mr. Garrow. If you please.

+

Prisoner. I found he wished to suppose me not right in my senses, and that he could produce no proof; he has declared in the public papers, that I behaved in such a violent manner, in his house, as totally to prove myself out of my senses; I have the facts now on one side put down, that I can find no one circumstance of the kind, and to put such a letter into the news paper; if they wish to make a man appear insane, he should be taken before the Lord Chancellor, and there make a general declaration, some way or other; but it is done to interfere with the liberty of the subject.

+

Mr. Garrow. Mr. Frith, how long was afflicted with that complaint in your ear? - I indured it, I supposed it merely as a triffling thing, but that complaint arises from a power of witchcraft, which existed about a hundred years ago, in this country; there is a power which women are now afflicted with; there is a power that rules now, that women can torment men, if they are in a room - over your head, they may annoy you by speaking in your ear; I have had a noise in my ear like speech; it is in the power of women, to annoy men publickly, even throughout the whole continent.

+

Mr. Garrow. Could you satisfy one of the Jury, that such a noise exists in your ear at this time?

+

Prisoner. That there is a noise in my ear at this time?

+

Mr. Garrow. Yes.

+

Prisoner. No, I am free from it now.

+

Mr. Garrow. Oh! you are free from it now?

+

Prisoner. Yes, but it is the power and effects, of what they call witchcraft, or some kind of communication between women and men; but I have remained such a chaste man for these four years, that it has fallen upon me particularly; and the Physician, by leaving me a month ago, and visiting me as friend, will totally speak to the fact; the last time he visited me, was on the 19th of March, says he, I hope you will be restored, and fit to take your trial; but I know your friend Mr. Hogarth, I have seen him, and some people that are in Court, will be able to declare me in my senses: I have said little or nothing at all lately, and been totally silent, so that it is impossible for me to be in that state. Shall I beg the favor to address my Lord.

+

Lord Chief Justice. If you please, Sir.

+

Prisoner. Do you recollect me, in the year 1773, when I applied to you in person, on a case of some landed property, between me and one Entwille, at Cheshire; when you was a counsel and was one of my counsel, with one Mr. Hughes, knowing me then, and likewise in October, at the assizes, respecting some contested property, some landed property I have in Cheshire; now that circumstance may corroborate my declaration of the state of my mind.

+

Lord Chief Justice. I do not recollect it.

+

Mr. FULLER sworn.

+

I have frequently seen Mr. Frith, since he came from the East Indies; I have had opportunities of conversing with him at particular times.

+

Mr. Shepperd. Do you recollect any thing particular in his conversation, that induced you to take notice of the state of his mind? - Yes, several times; on Christmas Eve was two years, I spent four hours with him; I conversed with him for three hours before I knew any thing was the matter with him, and upon asking him a question, respecting the matters he had mentioned before, concerning his ill treatment by Major Amherst , and Ensign Steward, in the West Indies; he declared then the reason he was ill treated, was, that he wished to reveal what the government wished to conceal; for that he saw a cloud come down from Heaven, that it cemented into a rock, and out of that sprung a false island of Jamaica, and because he wished to reveal it, he had, he said, been confined one hundred and sixty-tree days; and they had taken different means; that he had taken an oath of this before Sir Sampson Wright: a copy of which he gave me, and he wanted to have it published, but Woodfall, the printer, refused; and he said, he hoped, that I, as one of his friends, I would make it a conversation, in hopes it would reach the ears of the king; I thought that the speech of a madman; and he said, that he had wrote to the King and to Sir George Young , the secretary of war, and could receive no redress, and that they had reduced him to half pay: I understood that a Gentleman of the name of Garrow, was employed as his counsel, and I sent the copy of this oath enclosed in a letter, to\ in\ form him of it: I last Christmas day, by chance, went into the same friend's house, at No. 22, in Frith street; there I drank tea with Mr. Frith; he then told me, he was worse used then common, that he was persecuted, and that they wanted to set him up as antichrist, or a fourth person in the Godhead, and that he looked upon to be blasphemy, or else he might have a good living; that and many other instances I can prove if necessary.

+

Did you believe him to be in his senses? - No, upon my oath, and upon that one subject of his conceiving himself to be in his senses, and ill treated, and particularly by government.

+

If I understand you right, the last conversation that happened, was about a month before the circumstance happened, for which he was taken up? - Yes, Sir, and there were four people more that heard it.

+

Court. Gentlemen of the Jury, the enquiry which you are now called upon, is not whether the prisoner was in this unfortunate state of mind, when the accident happened, nor is it necessary to discuss or enquire at all, what effect his present state of mind may have, whenever that question comes to be discussed; but the humanity of the law of England falling into that, which common humanity, without any written law would suggest, has prescribed, that no man shall be called upon to make his defence, at a time when his mind is in that situation, as not to appear capable of so doing; for, however guilty he may be, the enquiring into his guilt, must be postponed to that season, when, by collecting together his intellects, and having them entire; he shall be able so to model his defence, as to ward off the punishment of the law; it is for you, therefore, to enquire whether the prisoner is now in that state of mind; and inasmuch as artful men may put on appearances which are not the reality of the case; I think the counsel for the prisoner have judged extremely proper for your satisfaction and the public's; not to suffer your judgment to proceed on that which he has now said, though that is extremely pregnant with observation; but they have called witnesses, and gone back to the earlier period of his life, and stated to you, at a time when the two letters were written, the language of which you have heard, which seems to me, not to leave any doubt on any man's mind, therefore, the question the Court proposes to you now, is, Whether he is at this time in a sane or an insane state of mind?

+

Prisoner. Permit me to speak, the physician is the most principal person, who has visited me as a friend, he can tell more than from any other private person's declarations what ever; I appeal as a British subject.

+

Jury. My Lord, we are all of opinion that the prisoner is quite insane .

+

Court. He must be remanded for the present.

+

Prisoner. Then I must call on that physician, who said, on the 19th, I was perfectly in my senses.

+

The prisoner was then removed from the bar.

+
+ +
+ +
+
diff --git a/dkpro-core-io-tei-asl/src/test/resources/tei_p4/OBC2-17900417_reference.xml b/dkpro-core-io-tei-asl/src/test/resources/tei_p4/OBC2-17900417_reference.xml new file mode 100644 index 0000000000..2ebb1698fc --- /dev/null +++ b/dkpro-core-io-tei-asl/src/test/resources/tei_p4/OBC2-17900417_reference.xml @@ -0,0 +1,306 @@ +OBC2-17900417.xml + + + + + + + + + + + + + + + THE WHOLE PROCEEDINGS On postponing the Trial of JOHN FRITH, FOR High-Treason, On SATURDAY, APRIL 17th, 1790, At JUSTICE-HALL, in the OLD BAILEY, CONTAINING The SPEECHES of the PRISONER, The EVIDENCE of the Reverend Mr. VILLETTE, Mr. Alderman NEWMAN and others, respecting his present Insanity. +

TAKEN IN SHORT-HAND BY E. HODGSON, PROFESSOR OF SHORT-HAND; And Published by Authority.

+

NUMBER IV. PART + + I. + + + + (Of the SESSIONS PAPER.)

+

LONDON:

+

Printed for E. HODGSON (the Proprietor); And Sold by him, at his House, No. 14, White Lion Street, Islington; Sold also by + + J. + + + + WALMSLAY, No. 35, Chancery Lane; S. BLADON, No. 13, Pater-noster Row; and C. D. PIGUENIT, No. 8, Aldgate.

+

MDCCXC.

+

+ BEFORE the Right Honourable WILLIAM PICKETT, + + LORD + MAYOR + + + + + of the City of London; the Rt. Honourable + + LLOYD + Lord + + + + + KENYON, Lord Chief Justice of His Majesty's Court of King's Bench; Sir + + BEAUMONT + HOTHAM + + + + + , Knt. one of the Barons of his Majesty's Court of Exchequer; the Honourable + + JOHN + HEATH + + + + + , Esq; one of the Justices of His Majesty's Court of Common Pleas; + + JOHN + WILLIAM ROSE + + + + + , Esq; Serjeant at Law, Recorder of the said City, and others his Majesty's Justices of Oyer and Terminer of the City of London, and Justices of Gaol Delivery of Newgate, holden for the said City and County of Middlesex.

+ +

Second Middlesex Jury.

+

+ + + William + George + + + + + .

+

+ + + Dutton + Greenwood + + + + + .

+

+ + + William + Augustus Mitchell + + + + + .

+

+ + + Kains + Ford + + + + + .

+

+ + + John + Dell + + + + + .

+

+ + + William. + May + + + + + .

+

+ + + Thomas + Hill + + + + + .

+

+ + + William + Matthews + + + + + .

+

+ + + Francis + Osliffe + + + + + .

+

+ + + William + Ramsden + + + + + .

+

+ + + William + Sedcole + + + + + .

+

+ + + Laban + Tilbrooke + + + + + .

+ +

Counsel for the Crown.

+

Mr. ATTORNEY GENERAL.

+

Mr. SOLICITOR GENERAL.

+

Mr. LAW.

+

Mr. SILVESTER.

+

Counsel for the Prisoner.

+

Mr. SHEPHERD and

+

Mr. GARROW.

+ + + + + + + + + + +

328. THE prisoner being put to the bar, the clerk began to arraign him:

+

" JOHN FRITH , you stand indicted by the name of John Frith :" when Mr. Shepherd, one of his counsel, addressed the Court as follows:

+

Mr. Shepherd. My lord, before the prisoner is arraigned, I wish to make an application. To day my friend, Mr. Garrow, and myself, are counsel for the defendant, Mr. Frith: and though we are furnished with what we think a sufficient defence, yet we should feel ourselves deficient, if while we thought so, there was other evidence that could be brought forward; and we think there is some very important evidence which might be procured before the next sessions, on behalf of Mr. Frith: on that account, we, as counsel for him, apply to the humanity of the Attorney General, to beg he would consent to the postponing this trial to the next sessions. In this case we exercise our duty as counsel: Mr. Frith is entitled to the best of our judgment: whether he will chuse to be guided that, is certainly a consideration for his own mind. Mr. Attorney General always will attend to applications of this sort; we therefore do hope that he will consent.

+

Court. This application is made on your judgment.

+

Mr. Garrow. I entirely concur with my learned friend. We certainly, as counsel, are suitors to Mr. Attorney General's humanity, that more time may be allowed for the prisoner's defence. Whether Mr. Frith himself will or will not consent, I do not know.

+

Mr. Garrow to Mr. Frith. Mr. Frith, we have been applying to the Court, or to Mr. Attorney General, to permit your trial to stand over till next sessions, upon our judgment; it appearing to us that it will be better, and your defence better arranged.

+

Prisoner. I object to it, on account of my health, being in a bad state through long confinement. I should rather meet it now: it is depriving a subject of his liberty, and endangering his health.

+

Mr. Attorney General. Notwithstanding what this unhappy gentleman has said, I am given to understand that there may be some circumstances in his situation; and likewise that he is not very well able in point of pecuniary concerns, to be so ready in the collection of materials for his defence, as many other prisoners are: therefore if my friends are of opinion that he must go to his trial now under great disadvantages, possibly arising from the last cause, as well as the other, I shall have no objection to give the gentlemen such time as will enable them to collect such evidence as they may chuse.

+

Prisoner. Then I shall make an application to some member of parliament, or the legislature. I therefore totally appeal against such power of putting off the trial any further; and whoever dares to oppose me in that respect, I will represent him to the legislature, or some member of parliament; either to General North, or some gentleman whom I have the honour of knowing.

+

Mr. Garrow. My lord, we are put into an arduous situation. But for one, I feel it to be my, duty to take upon myself, in opposition to the prisoner, for the prisoner's benefit, to pray that the Court, or rather the Attorney General, will consent to postponing this trial.

+

Court. Mr. Attorney General has conducted himself on this occasion, as he always does, exceedingly liberal and proper; and is ready to give all that indulgence that humanity calls for, because justice could not be attained without reasonable delay interposing, therefore it must stand over till next sessions.

+

Prisoner. I do not admit of it. And I shall make an application to parliament, that I have been here three months in disagreeable confinement; and the king has broke the mutual obligation between him and the subject: and the assault is of such a simple kind of manner; and what I have met with is of such a nature, that I desire to speak by way of extenuation, and to plead guilty or not guilty to the facts. I then shall make an application as being illegally detained in prison, that you will not admit a British subject to plead to the indictment: I therefore shall make an application to the legislature, that you are violating the laws of this kingdom. I will not put it in the power of the gentlemen that are employed for me to put it off.

+

Court. It is impossible for the most inattentive observer not to be aware that there may in this case be a previous enquiry necessary: such is the humanity of the law in England, that in all stages, both when the act is committed, at the time when the prisoner makes his defence, and even at the day of execution, it is important to settle what his state of mind is; and at the time he is called to plead, if there are circumstances that suggest to one's mind, that he is not in the possession of his reason, we must certainly be careful that nothing is introduced into the administration of justice, but what belongs to that administration. The justice of the law has provided a remedy in such cases; therefore I think there ought now to be an enquiry made, touching the sanity of this man at this time; whether he is in a situation of mind to say what his grounds of defence here are. I know it is untrodden ground, though it is constitutional: then get a jury together to enquire into the present state of his mind: the twelve men that are there, will do.

+

Prisoner to Mr. Garrow. I beg the favour to speak to you.

+

Mr. Garrow. By all means, Sir.

+

+ Prisoner. The privy counsel were pleased to send the king's physician to me, after I had appeared before my Lord Kenyon, on the 22d of January. I was examined at the privy counsel by Lord Camden; and they sent the king's physician to me. I made dates and memorandums of the physician's visits, likewise remarks that I spoke to him at various times; and of the apothecary's visits also: they persevered in my being in perfect health, fit to meet my trial; and I have put down the conversations.

+

Mr. Justice Heath. The jury will take notice of that.

+

The jury sworn as follows.

+

"You shall diligently enquire, and true presentment make, for, and on behalf of our sovereign lord the king, whether John Frith, the now prisoner at the bar, who stands indicted for + + + high treason + , be of sound mind and understanding, or not, and a true verdict give according: to the best of your understanding, so help you God."

+

Mr. Shepherd. Mr. Frith, you are aware that the gentlemen of the jury, that have been just worn, are going to enquire whether you are in a fit situation to plead at this time, and to be tried. Now I wish you would state to these gentlemen what reasons you have to give, to induce them to think you are, and to produce any memorandums.

+

Prisoner. I have had a physician attended me two months past. On the 22d of January, I came into these circumstances: and they were pleased to send the king's physician to examine me, whether I was perfectly in my senses: I persevered in being so, and would take no drugs from the apothecary. I begged him to attend as a friend to me, to protect me from insult, supposing there was any possibility that I could be insulted in this great prison: but if I had not been well, I would have had my own physician, Dr. Heberden, who attended my father formerly, when living: I looked upon him as a friend attending me, to prove that I was in my senses, or any thing else. I made memorandums of his visits, and the various conversations that we had together. I made memorandums likewise of letters: a letter which I wrote to Mess. Cox and Greenwood; and I have a copy of it, and one that I wrote about the 24th of February, during the time that the last sessions was here, when I thought I might be tried; I then recopied it again. I then mentioned that a disagreeable thing had happened, that General Clarke is coming home in disgrace. To hide that infamy that has happened, they wished to give it out that I was out of my senses. The agents who had immediately freed me from the inconveniences I was under, they were ordered to deny the subject the liberty of drawing on his agent on the house where he had money to answer his bills. They acknowledged me to have been perfectly in my senses at the time when I first came to England; I drew on them, and I have totally freed myself from the inconvenience I was under, from being improperly detained in the county of Cheshire. I was writing a letter of what was publickly given out concerning the subject: I then wrote to Mess. Cox, Cox and Greenwood, to beg they would send down some gentlemen here, to prove how the liberty of the subject was invaded in 1787, in June; and such letters will prove, that the 24th of last February, I was right in my mind then; and that now I recopied it again about a fortnight ago: and it went through my attorney, to Mess. Cox, Cox and Greenwood's house: that will prove the state of my mind at that period of time.

+

Mr. Garrow. Will you have the goodness, Mr. Frith, to state to the jury the circumstance that took place on your arrival at Liverpool, about the clergyman.

+

Prisoner. When I first arrived at Liverpool I perceived I had some powers like those which St. Paul had; and the sun that St. Paul gives a description of in the Testament; an extraordinary power that came down upon me, the power of Christ; in consequence of my persecution and being ill used, the public wanted to receive me as a must extraordinary kind of a man; they would have received me in any manner that I pleased; when I went to St. Thomas's church I was there surprised to hear the clergyman preach a most extraordinary sermon upon me, as if I was a God: I found my friends wanted me to support that kind of fanaticism in this country; this sermon was printed afterwards by Eyre, the printer at Warrington; when I came to London to the king concerning some military business, I told him nothing about any supernatural abilities, or the power of God; when I went to the Infirmary over Westminster-bridge, to the Asylum, I was surprised to hear General Washington's late Chaplain, Mr. Duche, he said, I remember the words he said,

+

"see him clothed in grace," pointing to me; there were some supernatural appearances at that time, therefore I could wish the privy council, when I came to England, or the Parliament, might be witnesses that I did not want to set up any kind of powers to the public; but there are such extraordinary appearances that attend me at this moment, that it is singular; and all I do daily is to make memorandums, daily to prove myself in my senses: some friends in Cheshire wanted me to set up some kind of fanaticism, some new branch of religion.

+

Mr. Garrow. Would you be so good, Mr. Frith, to\ in\ form the Court, as you have an opportunity now, of the complaint you made to me of the effect your confinement has upon you, and the pain in your ear?

+

Prisoner. In respect to the body of people, St. Paul when he was at Jerusalem, the same kind of power then came down on the public; there is both a kind of good and evil power which we are all liable to in this world; in consequence of that I feel myself in a particularly disagreeable situation in confinement; I am under a state of suffocation almost, the divine ordinances weighing so very low down that I am entirely reduced to a shadow almost, that is all to me as if it was a death seemingly, I am so in a state of confinement.

+

The Rev. Mr. VILLETTE sworn.

+

Mr. Garrow. I believe, Sir, you have had an opportunity of conversing with this gentleman since he has been in custody? - Yes.

+

State the impressions that such conversations made on your mind? - The first time I saw him I really thought from the appearance he had, that he was deranged in his mind; I took notice so to the man that had the care of him; some time after he sent for a bible; I sent him one; then we had some conversation; and he told me he had a pocket volume of that book, but that they took it from him when he was before the privy council; he said, I am much obliged to you: I went to him a few days ago; he was reading; he said, it was the Psalms; I then talked about his trial; and he then entered into such conversation as you have heard about St. Paul and Christ.

+

This conversation is not new, you have heard it before? - Yes.

+

Prisoner. I said it was when I was landed at Liverpool, and was giving a narrative.

+

Mr. Garrow. From the whole of your intercourse with him did it appear to you that he was insane? - I really thought so.

+

You think so now? - I do.

+

+ + + RICHARD + AKERMAN + + + + + , Esq. sworn.

+

You have had frequent opportunities of seeing Mr. Frith? - I have frequently seen Mr. Frith; I have been with him frequently.

+

State from the conversation you have bad with him, and his conduct on the whole, what your opinion is of the state of his mind? - It is very hard I should be called upon; I have heard such conversation as you have heard in Court.

+

Mr. Garrow. I will not trouble Mr. Akerman.

+

+ Prisoner. I have been very silent and close for many reasons, and to protect my person; I have read the Psalms, my Lord, as I had no other books.

+

Mr. Sheriff NEWMAN sworn.

+

Mr. Shepherd. Have you had any conversation with Mr. Frith since he has been in custody? - Very frequently; I went the second day after he was in Newgate; I went entirely out of curiosity; I found him a subject of great compassion: he began talking to me very deranged for the first ten minutes; I asked him why he went over to Holland? he said, he went eastward in pursuit of the light; I said, what light? he said, why you have read the scriptures? I said, yes; says he, the same light that fell upon St. Paul when he went to Damascus; I said, what brought you back? why, says he, when I got there I found the light was in the west as well as in the east. He desired to have the liberty of walking in the yard; and I consulted Mr. Akerman: and he said, there was an order concerning him. I found him every time in the same way; I was there once when Dr. Millan came down; I met him there; he for the first five minutes had doubts, but before he went away he was perfectly satisfied the prisoner was insane; I have not the least doubt, nor possibly can have a doubt; I frequently found him reading in the book of Kings, and he told me he was learning the art of war, and he should come to be a general, and he should like to understand the art of making war as the ancients did.

+

Prisoner. I do not remember speaking about that, and I made memorandums of my conversations with Mr. Newman: I never spoke about particular lights; I said, when I went over to Holland, as the ministers neglected doing their duty to me as a subject, in protecting me from the insults of the body of people; stirring up licentiousness, aiming at me; they drove me out of the kingdom; I went to Holland to shelter myself from the body of the people; but I do not remember saying any thing of following the light.

+

To Mr. Newman. Do you think it was absolute incapacity of mind, or feigned or assumed? - I believe absolutely that he is totally deranged, and not in the use of his senses for ten minutes together; every day I saw him he was so, and of that there is not a doubt; I went at different times merely to make observations.

+

Mr. Garrow. Mr. Frith, are you acquainted with Mr. Burnsell the auctioneer? - Yes; he took an extraordinary liberty in putting into the Public Advertiser, the third of February, a letter, dated the first, declaring me insane, a most extraordinary liberty; I thought it prudent to keep a copy: I have made memorandums, but they have been taken from me by Colonel Amherst, the same as Mr. Wilkes's papers were seized, a kind of alteration of the laws of the land, a kind of scheme to make a man appear insane, to totally disguise, to undo the liberty of the British subject; in fact it is such a concealed evil that I do not know where it will end.

+

Had Mr. Burnsell any ill will to you?

+

- None at all; he was only employed to hide the mutiny that those applauses of the clergymen had occasioned; he went to a person that lives with Mrs. Dowdswell, in Upper Brook-street; he had a letter, and was perhaps see'd; the clergyman declared me as a God, the body of the people as a man insane; myself applying to the King merely to get my birth again; when I went to my friend Mr. Burnsell, I spoke of no powers of God or Christ.

+

Mr. Garrow. Was that before the complaint that you was afflicted with in your ear?

+

Prisoner. Before that, the pain in my ear; shall I finish with respect to Mr. Burnsell?

+

Mr. Garrow. If you please.

+

Prisoner. I found he wished to suppose me not right in my senses, and that he could produce no proof; he has declared in the public papers, that I behaved in such a violent manner, in his house, as totally to prove myself out of my senses; I have the facts now on one side put down, that I can find no one circumstance of the kind, and to put such a letter into the news paper; if they wish to make a man appear insane, he should be taken before the Lord Chancellor, and there make a general declaration, some way or other; but it is done to interfere with the liberty of the subject.

+

Mr. Garrow. Mr. Frith, how long was afflicted with that complaint in your ear? - I indured it, I supposed it merely as a triffling thing, but that complaint arises from a power of witchcraft, which existed about a hundred years ago, in this country; there is a power which women are now afflicted with; there is a power that rules now, that women can torment men, if they are in a room - over your head, they may annoy you by speaking in your ear; I have had a noise in my ear like speech; it is in the power of women, to annoy men publickly, even throughout the whole continent.

+

Mr. Garrow. Could you satisfy one of the Jury, that such a noise exists in your ear at this time?

+

Prisoner. That there is a noise in my ear at this time?

+

Mr. Garrow. Yes.

+

Prisoner. No, I am free from it now.

+

Mr. Garrow. Oh! you are free from it now?

+

Prisoner. Yes, but it is the power and effects, of what they call witchcraft, or some kind of communication between women and men; but I have remained such a chaste man for these four years, that it has fallen upon me particularly; and the Physician, by leaving me a month ago, and visiting me as friend, will totally speak to the fact; the last time he visited me, was on the 19th of March, says he, I hope you will be restored, and fit to take your trial; but I know your friend Mr. Hogarth, I have seen him, and some people that are in Court, will be able to declare me in my senses: I have said little or nothing at all lately, and been totally silent, so that it is impossible for me to be in that state. Shall I beg the favor to address my Lord.

+

Lord Chief Justice. If you please, Sir.

+

Prisoner. Do you recollect me, in the year 1773, when I applied to you in person, on a case of some landed property, between me and one Entwille, at Cheshire; when you was a counsel and was one of my counsel, with one Mr. Hughes, knowing me then, and likewise in October, at the assizes, respecting some contested property, some landed property I have in Cheshire; now that circumstance may corroborate my declaration of the state of my mind.

+

Lord Chief Justice. I do not recollect it.

+

Mr. FULLER sworn.

+

I have frequently seen Mr. Frith, since he came from the East Indies; I have had opportunities of conversing with him at particular times.

+

Mr. Shepperd. Do you recollect any thing particular in his conversation, that induced you to take notice of the state of his mind? - Yes, several times; on Christmas Eve was two years, I spent four hours with him; I conversed with him for three hours before I knew any thing was the matter with him, and upon asking him a question, respecting the matters he had mentioned before, concerning his ill treatment by Major Amherst , and Ensign Steward, in the West Indies; he declared then the reason he was ill treated, was, that he wished to reveal what the government wished to conceal; for that he saw a cloud come down from Heaven, that it cemented into a rock, and out of that sprung a false island of Jamaica, and because he wished to reveal it, he had, he said, been confined one hundred and sixty-tree days; and they had taken different means; that he had taken an oath of this before Sir Sampson Wright: a copy of which he gave me, and he wanted to have it published, but Woodfall, the printer, refused; and he said, he hoped, that I, as one of his friends, I would make it a conversation, in hopes it would reach the ears of the king; I thought that the speech of a madman; and he said, that he had wrote to the King and to Sir George Young , the secretary of war, and could receive no redress, and that they had reduced him to half pay: I understood that a Gentleman of the name of Garrow, was employed as his counsel, and I sent the copy of this oath enclosed in a letter, to\ in\ form him of it: I last Christmas day, by chance, went into the same friend's house, at No. 22, in Frith street; there I drank tea with Mr. Frith; he then told me, he was worse used then common, that he was persecuted, and that they wanted to set him up as antichrist, or a fourth person in the Godhead, and that he looked upon to be blasphemy, or else he might have a good living; that and many other instances I can prove if necessary.

+

Did you believe him to be in his senses? - No, upon my oath, and upon that one subject of his conceiving himself to be in his senses, and ill treated, and particularly by government.

+

If I understand you right, the last conversation that happened, was about a month before the circumstance happened, for which he was taken up? - Yes, Sir, and there were four people more that heard it.

+

Court. Gentlemen of the Jury, the enquiry which you are now called upon, is not whether the prisoner was in this unfortunate state of mind, when the accident happened, nor is it necessary to discuss or enquire at all, what effect his present state of mind may have, whenever that question comes to be discussed; but the humanity of the law of England falling into that, which common humanity, without any written law would suggest, has prescribed, that no man shall be called upon to make his defence, at a time when his mind is in that situation, as not to appear capable of so doing; for, however guilty he may be, the enquiring into his guilt, must be postponed to that season, when, by collecting together his intellects, and having them entire; he shall be able so to model his defence, as to ward off the punishment of the law; it is for you, therefore, to enquire whether the prisoner is now in that state of mind; and inasmuch as artful men may put on appearances which are not the reality of the case; I think the counsel for the prisoner have judged extremely proper for your satisfaction and the public's; not to suffer your judgment to proceed on that which he has now said, though that is extremely pregnant with observation; but they have called witnesses, and gone back to the earlier period of his life, and stated to you, at a time when the two letters were written, the language of which you have heard, which seems to me, not to leave any doubt on any man's mind, therefore, the question the Court proposes to you now, is, Whether he is at this time in a sane or an insane state of mind?

+

Prisoner. Permit me to speak, the physician is the most principal person, who has visited me as a friend, he can tell more than from any other private person's declarations what ever; I appeal as a British subject.

+

Jury. My Lord, we are all of opinion that the prisoner is quite insane .

+

Court. He must be remanded for the present.

+

Prisoner. Then I must call on that physician, who said, on the 19th, I was perfectly in my senses.

+

The prisoner was then removed from the bar.

+ + + + +
\ No newline at end of file diff --git a/dkpro-core-io-tei-asl/src/test/resources/tei_p4/README.html b/dkpro-core-io-tei-asl/src/test/resources/tei_p4/README.html new file mode 100644 index 0000000000..81432fd83f --- /dev/null +++ b/dkpro-core-io-tei-asl/src/test/resources/tei_p4/README.html @@ -0,0 +1,8 @@ + + + +

The Old Bailey Corpus 2.0

+

Please visit the Old Bailey Corpus 2.0 landing page for further information about the corpus.

+

The Old Bailey Corpus 2.0 is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (summary, license text).

+ +