|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gate.util.AbstractFeatureBearer | +--gate.creole.AbstractResource | +--gate.creole.AbstractProcessingResource | +--gate.creole.AbstractLanguageAnalyser | +--gate.creole.APFormatExporter
This class implements a APF xml exporter. It works on documents or corpora to export them in the APF format.
Nested Class Summary |
Nested classes inherited from class gate.creole.AbstractProcessingResource |
AbstractProcessingResource.InternalStatusListener, AbstractProcessingResource.IntervalProgressListener |
Field Summary | |
static String |
APF_EXP_DOCUMENT_PARAMETER_NAME
|
static String |
APF_EXP_DTD_PARAMETER_NAME
|
static String |
APF_EXP_PATH_PARAMETER_NAME
|
static String |
APF_EXP_SOURCE_PARAMETER_NAME
|
static String |
APF_EXP_TYPES_PARAMETER_NAME
|
static String |
APF_EXP_WRITE_SOURCE_PARAMETER_NAME
|
private static boolean |
DEBUG
Debug flag |
private String |
docId
This field represent the document id and it is used in generating the entities IDs. |
private String |
dtdFileName
This is the name of the dtd file. |
private int |
entityId
This field represent an unique entity ID generator |
private List |
exportedTypes
This list of strings represents the entities type that will be exported |
private URL |
exportFilePath
|
private boolean |
isSourceWritten
The source attribute for source |
private int |
mentionId
added by Di - this field represents a unique entity ID generator |
private String |
source
The source attribute for source |
private StringBuffer |
xmlDoc
This is the xmlDoc that will be created |
Fields inherited from class gate.creole.AbstractLanguageAnalyser |
corpus, document |
Fields inherited from class gate.creole.AbstractProcessingResource |
interrupted |
Fields inherited from class gate.creole.AbstractResource |
name, serialVersionUID |
Fields inherited from class gate.util.AbstractFeatureBearer |
features |
Constructor Summary | |
APFormatExporter()
Constructor does nothing. |
Method Summary | |
void |
execute()
Run the resource and does the entire export process |
String |
getDtdFileName()
Java bean style accesor for DtdFileName |
List |
getExportedTypes()
Java bean style accesor for exportedTypes |
URL |
getExportFilePath()
Java bean style accesor for exportFilePath |
Boolean |
getIsSourceWritten()
Java bean style accesor for isSourceWritten |
private int |
getNextEntityId()
Returns the next safe ID for an entity |
private int |
getNextMentionId()
added by Di - returns the next safe ID for an entity mention |
String |
getSource()
Java bean style accesor for source |
Resource |
init()
Initialise this resource, and returns it. |
private void |
initDocId()
Initialises the docId with documents' file name without the complete path |
private void |
serializeAnEntity(List anEntity)
Writes an entity in the xmlDoc conforming to APF standards. |
private void |
serializeAnEntityAttributes(Annotation ann)
This method serializes an entity attribute from an Annotation |
private void |
serializeAnEntityMention(Annotation ann)
This method serializes an entity mention from an Annotation |
protected void |
serializeDocumentToAPF()
Returns the xml document conforming to APF dtd. |
protected void |
serializeEntities()
Transforms all the entities from exportedTypes found in the GATE document into their xml representation |
void |
setDtdFileName(String aDtdFileName)
Java bean style mutator for dtdFileName |
void |
setExportedTypes(List anExportedTypesList)
Java bean style mutator for exportedTypes |
void |
setExportFilePath(URL anExportFilePath)
Java bean style mutator for exportFilePath |
void |
setIsSourceWritten(Boolean aIsSourceWritten)
Java bean style mutator for isSourceWritten |
void |
setSource(String aSource)
Java bean style mutator for source |
Methods inherited from class gate.creole.AbstractLanguageAnalyser |
getCorpus, getDocument, setCorpus, setDocument |
Methods inherited from class gate.creole.AbstractProcessingResource |
addProgressListener, addStatusListener, cleanup, fireProcessFinished, fireProgressChanged, fireStatusChanged, interrupt, isInterrupted, reInit, removeProgressListener, removeStatusListener |
Methods inherited from class gate.creole.AbstractResource |
checkParameterValues, getName, getParameterValue, getParameterValue, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners |
Methods inherited from class gate.util.AbstractFeatureBearer |
getFeatures, setFeatures |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface gate.ProcessingResource |
reInit |
Methods inherited from interface gate.Resource |
cleanup, getParameterValue, setParameterValue, setParameterValues |
Methods inherited from interface gate.util.FeatureBearer |
getFeatures, setFeatures |
Methods inherited from interface gate.util.NameBearer |
getName, setName |
Methods inherited from interface gate.Executable |
interrupt, isInterrupted |
Field Detail |
public static final String APF_EXP_DOCUMENT_PARAMETER_NAME
public static final String APF_EXP_SOURCE_PARAMETER_NAME
public static final String APF_EXP_DTD_PARAMETER_NAME
public static final String APF_EXP_PATH_PARAMETER_NAME
public static final String APF_EXP_TYPES_PARAMETER_NAME
public static final String APF_EXP_WRITE_SOURCE_PARAMETER_NAME
private static final boolean DEBUG
private List exportedTypes
private String dtdFileName
private String docId
private int entityId
private int mentionId
private StringBuffer xmlDoc
private URL exportFilePath
private String source
private boolean isSourceWritten
Constructor Detail |
public APFormatExporter()
Method Detail |
public void execute() throws ExecutionException
execute
in interface Executable
execute
in class AbstractProcessingResource
ExecutionException
public Resource init() throws ResourceInstantiationException
init
in interface Resource
init
in class AbstractProcessingResource
ResourceInstantiationException
public void setExportedTypes(List anExportedTypesList)
public List getExportedTypes()
public void setDtdFileName(String aDtdFileName)
public String getDtdFileName()
public void setExportFilePath(URL anExportFilePath)
public URL getExportFilePath()
public void setSource(String aSource)
public String getSource()
public Boolean getIsSourceWritten()
public void setIsSourceWritten(Boolean aIsSourceWritten)
private void initDocId()
protected void serializeDocumentToAPF()
protected void serializeEntities()
private void serializeAnEntity(List anEntity)
anEntity
- represents a list with annotations that refer the same
entity. Those annotations were detected and constructed by the
orthomatcher.private void serializeAnEntityMention(Annotation ann)
private void serializeAnEntityAttributes(Annotation ann)
private int getNextEntityId()
private int getNextMentionId()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |