anl.aida.ae.gate
Class OutputAnnotationBuilder

java.lang.Object
  extended by anl.aida.ae.gate.AbstractUGAnnotationBuilder
      extended by anl.aida.ae.gate.OutputAnnotationBuilder
All Implemented Interfaces:
AnnotationBuilder

public class OutputAnnotationBuilder
extends AbstractUGAnnotationBuilder
implements AnnotationBuilder

Builds UIMA style annotations from GATE ones.


Field Summary
private  AnnotationBuilderFilter filter
           
private  boolean indexed
           
 
Fields inherited from class anl.aida.ae.gate.AbstractUGAnnotationBuilder
annotationSet, fBuilders, gateType, type
 
Constructor Summary
OutputAnnotationBuilder(java.lang.String gateType, org.apache.uima.cas.Type type, boolean indexed)
           
 
Method Summary
private  void buildAnnotation(org.apache.uima.cas.CAS cas, org.apache.uima.cas.text.AnnotationFS uAnt, gate.Annotation gAnt)
           
 boolean isIndexed()
          Returns whether or not this AnnotationBuilder will map the gate and uima annotations to each other.
 void run(org.apache.uima.cas.CAS cas, gate.Document doc, java.util.Map<java.lang.Integer,org.apache.uima.cas.FeatureStructure> indexMap)
          Runs the annotation builder using the supplied CAS and Document.
 void setFilter(AnnotationBuilderFilter filter)
          Adds the specified AnnotationBuilderFilter.
 
Methods inherited from class anl.aida.ae.gate.AbstractUGAnnotationBuilder
addFeatureBuilder, getAnnotationSet, getUIMAName, setAnnotationSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface anl.aida.ae.gate.AnnotationBuilder
addFeatureBuilder, getAnnotationSet, getUIMAName, setAnnotationSet
 

Field Detail

indexed

private boolean indexed

filter

private AnnotationBuilderFilter filter
Constructor Detail

OutputAnnotationBuilder

public OutputAnnotationBuilder(java.lang.String gateType,
                               org.apache.uima.cas.Type type,
                               boolean indexed)
Method Detail

run

public void run(org.apache.uima.cas.CAS cas,
                gate.Document doc,
                java.util.Map<java.lang.Integer,org.apache.uima.cas.FeatureStructure> indexMap)
         throws UGMappingException
Runs the annotation builder using the supplied CAS and Document. Annotations will be transfered between the two.

Specified by:
run in interface AnnotationBuilder
Parameters:
cas - the UIMA CAS
doc - the gate Document
indexMap - map of GATE Annotation id ints to UIMA AnnotationFS.
Throws:
UGMappingException - if there is an error while building the annotations.

buildAnnotation

private void buildAnnotation(org.apache.uima.cas.CAS cas,
                             org.apache.uima.cas.text.AnnotationFS uAnt,
                             gate.Annotation gAnt)

isIndexed

public boolean isIndexed()
Returns whether or not this AnnotationBuilder will map the gate and uima annotations to each other.

Specified by:
isIndexed in interface AnnotationBuilder
Returns:
true if the anntotations are mapped otherwise false.

setFilter

public void setFilter(AnnotationBuilderFilter filter)
Adds the specified AnnotationBuilderFilter.

Specified by:
setFilter in interface AnnotationBuilder
Parameters:
filter - the filter to add