org.xces.graf.uima.convert
Class CAS2Graf

java.lang.Object
  extended by org.xces.graf.uima.convert.CAS2Graf

public class CAS2Graf
extends Object

uses App.java to utilize command line input. updated to work with masc version 3

Version:
2.0
Author:
Cascio

Field Summary
protected  org.slf4j.Logger logger
           
protected  org.apache.uima.collection.CollectionReader mCollectionReader
           
protected  org.apache.uima.UimaContext mUimaContext
           
 
Constructor Summary
CAS2Graf()
           
 
Method Summary
 void convert(File inputFile, File outputDirectory, File typeSystemFile)
          Runs Graf2CAS
protected  void copyIntoTypeSystem(org.apache.uima.cas.CAS cas, org.xces.graf.util.NameMap nameMap, org.xces.graf.api.IGraph aGraph)
          copies TypeSystem from CAS to the global variable Master Type System
static String getContents(String file)
          Returns the contents of a file in the form of a String object
 org.apache.uima.cas.CAS loadCasFromXMI(File inputCasFile, File inputTypeSystemFile)
          given an xmi file containing cas, places Cas in aCas
 org.apache.uima.resource.metadata.TypeSystemDescription loadTypeSystemFromXMI(File TypeSystemFile)
           
 
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

mUimaContext

protected org.apache.uima.UimaContext mUimaContext

mCollectionReader

protected org.apache.uima.collection.CollectionReader mCollectionReader
Constructor Detail

CAS2Graf

public CAS2Graf()
Method Detail

loadTypeSystemFromXMI

public org.apache.uima.resource.metadata.TypeSystemDescription loadTypeSystemFromXMI(File TypeSystemFile)
                                                                              throws org.apache.uima.util.InvalidXMLException,
                                                                                     IOException
Throws:
org.apache.uima.util.InvalidXMLException
IOException

loadCasFromXMI

public org.apache.uima.cas.CAS loadCasFromXMI(File inputCasFile,
                                              File inputTypeSystemFile)
                                       throws org.apache.uima.resource.ResourceProcessException,
                                              IOException,
                                              org.apache.uima.resource.ResourceInitializationException,
                                              ParserConfigurationException,
                                              SAXException
given an xmi file containing cas, places Cas in aCas

Parameters:
aCas -
inputCasFile -
Throws:
org.apache.uima.resource.ResourceProcessException
IOException
org.apache.uima.resource.ResourceInitializationException
SAXException
ParserConfigurationException

convert

public void convert(File inputFile,
                    File outputDirectory,
                    File typeSystemFile)
             throws org.xces.graf.api.GrafException,
                    org.apache.uima.resource.ResourceInitializationException,
                    TypeSystemException,
                    org.apache.uima.resource.ResourceProcessException,
                    IOException,
                    ParserConfigurationException,
                    SAXException
Runs Graf2CAS

Throws:
org.xces.graf.api.GrafException
org.apache.uima.resource.ResourceInitializationException
TypeSystemException
IOException
org.apache.uima.resource.ResourceProcessException
SAXException
ParserConfigurationException

getContents

public static String getContents(String file)
                          throws Exception
Returns the contents of a file in the form of a String object

Parameters:
file -
Returns:
Throws:
IOException
Exception

copyIntoTypeSystem

protected void copyIntoTypeSystem(org.apache.uima.cas.CAS cas,
                                  org.xces.graf.util.NameMap nameMap,
                                  org.xces.graf.api.IGraph aGraph)
                           throws TypeSystemException
copies TypeSystem from CAS to the global variable Master Type System

Parameters:
cas -
nameMap -
aGraph -
Throws:
TypeSystemException


Copyright © 2012 American National Corpus. All Rights Reserved.