Package org.apache.uima.fit.component
Class CasDumpWriter
- All Implemented Interfaces:
AnalysisComponent
Dumps CAS content to a text file. This is useful when setting up test cases which contain a
reference output to which an actually produced CAS is compared. The format produced by this
component is more easily comparable than a XCAS or XMI format.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringPattern exclusion prefix.static final StringPattern inclusion prefix.static final StringInclude/exclude features according to the following patterns.static final StringOutput file.static final StringSort increasing by begin, decreasing by end, increasing by name instead of relying on index order.static final StringInclude/exclude specified UIMA types in the output.static final StringWhether to dump the content of theCAS.getDocumentAnnotation(). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidNotifies this AnalysisComponent that processing of an entire collection has been completed.voidinitialize(UimaContext context) Performs any startup tasks required by this component.voidInputs a CAS to the AnalysisComponent.Methods inherited from class org.apache.uima.analysis_component.CasAnnotator_ImplBase
getRequiredCasInterface, process, typeSystemInitMethods inherited from class org.apache.uima.analysis_component.Annotator_ImplBase
getCasInstancesRequired, hasNext, nextMethods inherited from class org.apache.uima.analysis_component.AnalysisComponent_ImplBase
batchProcessComplete, destroy, getContext, getLogger, getResultSpecification, reconfigure, setResultSpecification
-
Field Details
-
INCLUDE_PREFIX
Pattern inclusion prefix.- See Also:
-
EXCLUDE_PREFIX
Pattern exclusion prefix.- See Also:
-
PARAM_OUTPUT_FILE
Output file. If multiple CASes as processed, their contents are concatenated into this file. Mind that a test case using this consumer with multiple CASes requires a reader which produced the CASes always in the same order. When this file is set to "-", the dump does toSystem.out(default).- See Also:
-
PARAM_WRITE_DOCUMENT_META_DATA
Whether to dump the content of theCAS.getDocumentAnnotation().- See Also:
-
PARAM_FEATURE_PATTERNS
Include/exclude features according to the following patterns. Mind that the patterns do not actually match feature names but lines produced byFeatureStructure.toString().- See Also:
-
PARAM_TYPE_PATTERNS
Include/exclude specified UIMA types in the output.- See Also:
-
PARAM_SORT
Sort increasing by begin, decreasing by end, increasing by name instead of relying on index order.- See Also:
-
-
Constructor Details
-
CasDumpWriter
public CasDumpWriter()
-
-
Method Details
-
initialize
Description copied from interface:AnalysisComponentPerforms any startup tasks required by this component. The framework calls this method only once, just after the AnalysisComponent has been instantiated.The framework supplies this AnalysisComponent with a reference to the
UimaContextthat it will use, for example to access configuration settings or resources. This AnalysisComponent should store a reference to its theUimaContextfor later use.- Specified by:
initializein interfaceAnalysisComponent- Overrides:
initializein classCasConsumer_ImplBase- Parameters:
context- Provides access to services and resources managed by the framework. This includes configuration parameters, logging, and access to external resources.- Throws:
ResourceInitializationException- if this AnalysisComponent cannot initialize successfully.
-
process
Description copied from class:CasAnnotator_ImplBaseInputs a CAS to the AnalysisComponent. This method should be overriden by subclasses to perform analysis of the CAS.- Specified by:
processin classCasAnnotator_ImplBase- Parameters:
aCAS- A CAS that this AnalysisComponent should process.- Throws:
AnalysisEngineProcessException- if a problem occurs during processing
-
collectionProcessComplete
public void collectionProcessComplete()Description copied from interface:AnalysisComponentNotifies this AnalysisComponent that processing of an entire collection has been completed. In this method, this component should finish writing any output relating to the current collection.- Specified by:
collectionProcessCompletein interfaceAnalysisComponent- Overrides:
collectionProcessCompletein classAnalysisComponent_ImplBase
-