org.apache.uima.examples
Class PrintAnnotations

java.lang.Object
  extended by org.apache.uima.examples.PrintAnnotations

public class PrintAnnotations
extends java.lang.Object

A simple example of how to extract information from the CAS. This example retrieves all annotations of a specified type from a CAS and prints them (along with all of their features) to a PrintStream.


Constructor Summary
PrintAnnotations()
           
 
Method Summary
static void main(java.lang.String[] args)
          Main program for testing this class.
static void printAnnotations(CAS aCAS, java.io.PrintStream aOut)
          Prints all Annotations to a PrintStream.
static void printAnnotations(CAS aCAS, Type aAnnotType, java.io.PrintStream aOut)
          Prints all Annotations of a specified Type to a PrintStream.
static void printFS(FeatureStructure aFS, CAS aCAS, int aNestingLevel, java.io.PrintStream aOut)
          Prints a FeatureStructure to a PrintStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrintAnnotations

public PrintAnnotations()
Method Detail

printAnnotations

public static void printAnnotations(CAS aCAS,
                                    java.io.PrintStream aOut)
Prints all Annotations to a PrintStream.

Parameters:
aCAS - the CAS containing the FeatureStructures to print
aOut - the PrintStream to which output will be written

printAnnotations

public static void printAnnotations(CAS aCAS,
                                    Type aAnnotType,
                                    java.io.PrintStream aOut)
Prints all Annotations of a specified Type to a PrintStream.

Parameters:
aCAS - the CAS containing the FeatureStructures to print
aAnnotType - the Type of Annotation to be printed
aOut - the PrintStream to which output will be written

printFS

public static void printFS(FeatureStructure aFS,
                           CAS aCAS,
                           int aNestingLevel,
                           java.io.PrintStream aOut)
Prints a FeatureStructure to a PrintStream.

Parameters:
aFS - the FeatureStructure to print
aCAS - the CAS containing the FeatureStructure
aNestingLevel - number of tabs to print before each line
aOut - the PrintStream to which output will be written

main

public static void main(java.lang.String[] args)
Main program for testing this class. Ther are two required arguments - the path to the XML descriptor for the TAE to run and an input file. Additional arguments are Type or Feature names to be included in the ResultSpecification passed to the TAE.



Copyright © 2013. All Rights Reserved.