<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" | |
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"[ | |
<!ENTITY imgroot "../images/tools/tools.annotation_viewer/" > | |
<!ENTITY % uimaents SYSTEM "../entities.ent" > | |
%uimaents; | |
]> | |
<!-- | |
Licensed to the Apache Software Foundation (ASF) under one | |
or more contributor license agreements. See the NOTICE file | |
distributed with this work for additional information | |
regarding copyright ownership. The ASF licenses this file | |
to you under the Apache License, Version 2.0 (the | |
"License"); you may not use this file except in compliance | |
with the License. You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, | |
software distributed under the License is distributed on an | |
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
KIND, either express or implied. See the License for the | |
specific language governing permissions and limitations | |
under the License. | |
--> | |
<chapter id="ugr.tools.annotation_viewer"> | |
<title>Annotation Viewer</title> | |
<para>The <emphasis>Annotation Viewer</emphasis> is a tool for viewing analysis results | |
that have been saved to your disk as <emphasis>external XML representations of the | |
CAS</emphasis>. These are saved in a particular format called XMI. In the UIMA SDK, XML | |
versions of CASes can be generated by:</para> | |
<itemizedlist><listitem><para>Running the Document Analyzer (see <olink | |
targetdoc="&uima_docs_tools;" targetptr="ugr.tools.doc_analyzer"/>, which | |
saves an XML representations of the CAS to the specified output directory.</para> | |
</listitem> | |
<listitem><para>Running a Collection Processing Engine that includes the | |
<emphasis>XMI Writer </emphasis>CAS Consumer | |
(<literal>examples/descriptors/cas_consumer/XmiWriterCasConsumer.xml)</literal>. | |
</para></listitem> | |
<listitem><para>Explicitly creating XML representations of the CAS from your own | |
application using the org.apache.uima.cas.impl.XMISerializer class. The best way | |
to learn how to do this is to look at the example code for the XMI Writer CAS Consumer, | |
located in | |
<literal>examples/src/org/apache/uima/examples/xmi/XmiWriterCasConsumer.java</literal>. | |
<footnote><para>An older form of a different XML format for the CAS is also provided | |
mainly for backwards compatibility. This form is called XCAS, and you can see examples | |
of its use in | |
<literal>examples/src/org/apache/uima/examples/cpe/XCasWriterCasConsumer.java</literal>. | |
</para></footnote> </para></listitem></itemizedlist> | |
<note><para>The Annotation Viewer only shows CAS views where the Sofa data type is a String. | |
</para></note> | |
<para>You can run the Annotation Viewer by executing the | |
<literal>annotationViewer</literal> shell script located in the bin directory of the | |
UIMA SDK or the "UIMA Annotation Viewer" Eclipse run configuration in the | |
<literal>uimaj-examples</literal> project. This will open the following window: | |
<screenshot> | |
<mediaobject> | |
<imageobject> | |
<imagedata width="5.8in" format="JPG" fileref="&imgroot;image002.jpg"/> | |
</imageobject> | |
<textobject><phrase>Screenshot of annotationViewer</phrase></textobject> | |
</mediaobject> | |
</screenshot></para> | |
<para>Select an input directory (which must contain XMI files), and the descriptor for the | |
AE that produced the Analysis (which is needed to get the type system for the analysis). | |
Then press the <quote>View</quote> button.</para> | |
<para>This will bring up a dialog where you can select a viewing format and double-click on a | |
document to view it. This dialog is the same as the one that is described in <olink | |
targetdoc="&uima_docs_tools;" | |
targetptr="ugr.tools.doc_analyzer.viewing_results"/>.</para> | |
</chapter> |