Package org.apache.uima.fit.descriptor
Annotation Interface SofaCapability
@SofaCapability(inputSofas = { GOLD_VIEW, SYSTEM_VIEW })
or
@SofaCapability(inputSofas = CAS.NAME_DEFAULT_SOFA, outputSofas = GOLD_VIEW)
Adding this annotation to your analysis engine description makes your component "sofa aware." The
base CAS delivered to "sofa aware" components has no explicit view associated with it. The logic
is that it is impossible to know the intent of a sofa aware component and it should use getView
as needed. You should therefore be aware that if you need to work with the "_InitialView" view,
then you must explicitly request it with a call like:
JCas initialView = jCas.getView(CAS.NAME_DEFAULT_SOFA);
This is because the base CAS that it passed into the process method to "sofa aware" components is
not the same as the "_InitialView". See how the following member variable is used to understand
why/how:
org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.mSofaAware
-
Optional Element Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Provides the default value for the inputs and the outputs that tells the CapabilityFactory that no value has been given to the inputs or outputs elements.
-
Field Details
-
NO_DEFAULT_VALUE
Provides the default value for the inputs and the outputs that tells the CapabilityFactory that no value has been given to the inputs or outputs elements.- See Also:
-
-
Element Details
-
inputSofas
String[] inputSofasThe values should be string vales corresponding to view names such as e.g. CAS.NAME_DEFAULT_SOFA that this analysis component expects to be present in the CAS.- Returns:
- the input sofas
- Default:
- {"org.apache.uima.fit.descriptor.SofaCapability.NO_DEFAULT_VALUE"}
-
outputSofas
String[] outputSofasThe values should be string vales corresponding to view names that this analysis component will create.- Returns:
- the output sofas
- Default:
- {"org.apache.uima.fit.descriptor.SofaCapability.NO_DEFAULT_VALUE"}
-