@PipeBitInfo(name="Text Span Writer", description="Writes BSV files with original text for extracted annotations and their span offsets.", role=WRITER, dependencies=IDENTIFIED_ANNOTATION) public class TextSpanWriter extends org.apache.uima.fit.component.CasConsumer_ImplBase
Constructor and Description |
---|
TextSpanWriter() |
Modifier and Type | Method and Description |
---|---|
void |
initialize(org.apache.uima.UimaContext uimaContext) |
void |
process(org.apache.uima.cas.CAS aCAS) |
void |
process(org.apache.uima.jcas.JCas jcas)
Process the jcas and write pretty sentences to file.
|
void |
setOutputDirectory(String outputDirectoryPath) |
static void |
writeAnnotation(org.apache.uima.cas.text.AnnotationFS annotation,
Writer writer)
Write a sentence from the document text
|
getRequiredCasInterface, process, typeSystemInit
getCasInstancesRequired, hasNext, next
public void initialize(org.apache.uima.UimaContext uimaContext) throws org.apache.uima.resource.ResourceInitializationException
initialize
in interface org.apache.uima.analysis_component.AnalysisComponent
initialize
in class org.apache.uima.fit.component.CasConsumer_ImplBase
org.apache.uima.resource.ResourceInitializationException
public void process(org.apache.uima.cas.CAS aCAS) throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
process
in class org.apache.uima.analysis_component.CasAnnotator_ImplBase
org.apache.uima.analysis_engine.AnalysisEngineProcessException
public void setOutputDirectory(String outputDirectoryPath) throws IllegalArgumentException, SecurityException
outputDirectoryPath
- may be empty or null, in which case the current working directory is usedIllegalArgumentException
- if the provided path points to a File and not a DirectorySecurityException
- if the File System has issuespublic void process(org.apache.uima.jcas.JCas jcas)
jcas
- ye olde ...public static void writeAnnotation(org.apache.uima.cas.text.AnnotationFS annotation, Writer writer) throws IOException
annotation
- annotation containing the sentencewriter
- writer to which pretty text for the sentence should be writtenIOException
- if the writer has issuesCopyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.