org.xces.graf.uima
Class CASFactory

java.lang.Object
  extended by org.xces.graf.uima.CASFactory

public class CASFactory
extends Object

This class can be used to create a CAS given a graph, a type system and an index description.


Nested Class Summary
static class CASFactory.EdgeType
           
static class CASFactory.NeighborType
           
 
Field Summary
protected  org.xces.graf.uima.TypeSystemFactory.IAnnotationLabelMaker aLabelMaker
          Derives the type name for an annotation based on the (possible nested annotation set name and the annotation name.
protected  Map<String,List<org.apache.uima.cas.text.AnnotationFS>> annotationMap
          Map used to associate a node with a list of UIMA annotation feature structures.
protected  String annType
           
protected  org.xces.graf.uima.TypeSystemFactory.IAnnotationSpaceLabelMaker asLabelMaker
          Derives type names based on the annotation set name.
protected  CASFactory.EdgeType edgeType
           
protected  org.slf4j.Logger logger
           
protected  org.xces.graf.api.IAnchor ORIGIN
           
protected  Map<String,Object> userObjectMap
          Map used to preserve any previously assigned user object's in the graph.
 
Constructor Summary
CASFactory()
           
 
Method Summary
protected  void addAnnotations(org.apache.uima.cas.CAS theCas, org.xces.graf.api.INode theNode)
          given the cas and the node, places annotations, made from node, to the cas
protected  void addFeatures(String label, org.xces.graf.api.IFeature src, org.apache.uima.cas.Type aType, org.apache.uima.cas.text.AnnotationFS annotation)
          adds uimaStringValues to feature src
 org.apache.uima.cas.CAS createCas(org.xces.graf.api.IGraph graph, org.apache.uima.resource.metadata.TypeSystemDescription typeSystemDesc, org.apache.uima.resource.metadata.TypePriorities typePriorities, org.apache.uima.resource.metadata.FsIndexDescription[] index, org.xces.graf.util.NameMap nameMap)
           
protected  org.xces.graf.api.IAnnotationSpace getAnnSpace(org.xces.graf.api.IGraph graph)
          For a given graph, returns the annotation spaces.
protected  List<org.xces.graf.api.INode> getNeighbors(org.xces.graf.api.INode node, CASFactory.NeighborType type)
          given a node returns a list of either children or ancestors
 void useExplicitEdges()
           
 void useImplicitEdges()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected org.slf4j.Logger logger

asLabelMaker

protected org.xces.graf.uima.TypeSystemFactory.IAnnotationSpaceLabelMaker asLabelMaker
Derives type names based on the annotation set name. Also sets the type field in the annotation label maker.


aLabelMaker

protected org.xces.graf.uima.TypeSystemFactory.IAnnotationLabelMaker aLabelMaker
Derives the type name for an annotation based on the (possible nested annotation set name and the annotation name.


annotationMap

protected Map<String,List<org.apache.uima.cas.text.AnnotationFS>> annotationMap
Map used to associate a node with a list of UIMA annotation feature structures. This map is used when linking the annotations in the UIMA CAS into a tree. The UIMA feature structures represent the children of the node. The node's ID value is used as the key into the map.


userObjectMap

protected Map<String,Object> userObjectMap
Map used to preserve any previously assigned user object's in the graph.


ORIGIN

protected org.xces.graf.api.IAnchor ORIGIN

edgeType

protected CASFactory.EdgeType edgeType

annType

protected String annType
Constructor Detail

CASFactory

public CASFactory()
Method Detail

useImplicitEdges

public void useImplicitEdges()

useExplicitEdges

public void useExplicitEdges()

createCas

public org.apache.uima.cas.CAS createCas(org.xces.graf.api.IGraph graph,
                                         org.apache.uima.resource.metadata.TypeSystemDescription typeSystemDesc,
                                         org.apache.uima.resource.metadata.TypePriorities typePriorities,
                                         org.apache.uima.resource.metadata.FsIndexDescription[] index,
                                         org.xces.graf.util.NameMap nameMap)
                                  throws org.apache.uima.resource.ResourceInitializationException,
                                         org.apache.uima.cas.CASException,
                                         org.xces.graf.api.GrafException
Throws:
org.apache.uima.resource.ResourceInitializationException
org.apache.uima.cas.CASException
org.xces.graf.api.GrafException

getNeighbors

protected List<org.xces.graf.api.INode> getNeighbors(org.xces.graf.api.INode node,
                                                     CASFactory.NeighborType type)
given a node returns a list of either children or ancestors

Parameters:
node -
type -
Returns:

addAnnotations

protected void addAnnotations(org.apache.uima.cas.CAS theCas,
                              org.xces.graf.api.INode theNode)
                       throws org.apache.uima.cas.CASException,
                              org.xces.graf.api.GrafException
given the cas and the node, places annotations, made from node, to the cas

Parameters:
theCas -
theNode -
Throws:
org.apache.uima.cas.CASException
org.xces.graf.api.GrafException

addFeatures

protected void addFeatures(String label,
                           org.xces.graf.api.IFeature src,
                           org.apache.uima.cas.Type aType,
                           org.apache.uima.cas.text.AnnotationFS annotation)
                    throws TypeSystemException
adds uimaStringValues to feature src

Parameters:
label -
src -
aType -
annotation -
Throws:
TypeSystemException

getAnnSpace

protected org.xces.graf.api.IAnnotationSpace getAnnSpace(org.xces.graf.api.IGraph graph)
For a given graph, returns the annotation spaces. For now, we pass different possible type values to the IGraph getAnnotationSet method. Can method be called without explicitly specifying the type? This is to replace getAnnSet(INode node) for the HK graf-API . Also changed for the graf-api 1.1.0-SNAPSHOT

Parameters:
node -
Returns:
annSet


Copyright © 2012 American National Corpus. All Rights Reserved.