|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ResultSpecification
A ResultSpecification
is a set of desired outputs from a Analysis Engine or
Annotator. Each output is a reference to either a Type
or a
Feature
.
Annotator implementations may, but are not required to, check the ResultSpecification
passed as a parameter to their AnalysisComponent.setResultSpecification(ResultSpecification)
},
and produce only those Type
s and Feature
s that are part of the
ResultSpecification. Annotators can call the containsType(String)
and
containsFeature(String)
to determine which types and features belong to this
ResultSpecification and should be produced.
ResultSpecifications are language enabled to allow different values to be set and returned, based on a ISO language identifier. There are two styles of the get and add methods: one takes an additional parameter specifying the language(s), the other doesn't have this parameter. Using the one without the language parameter is equivalent to using the "x-unspecified" language. The functions that add ResultSpecifications can do this for multiple languages at once because the language parameter is an array of strings. The functions to retrieve a ResultSpecification specify one particular language.
If you query the ResultSpecification with a language with a country code (e.g. en-US), results for the base language (en) will be returned as well.
Method Summary | |
---|---|
void |
addCapabilities(Capability[] aCapabilities)
Adds the output types and features from the specified capabilities to this ResultSpecification . |
void |
addCapabilities(Capability[] aCapabilities,
boolean aOutputs)
Adds either outputs or inputs from the specified capabilities to this ResultSpecification . |
void |
addResultFeature(String aFullFeatureName)
Adds a Feature to this ResultSpecification for the language x-unspecified. |
void |
addResultFeature(String aFullFeatureName,
String[] aLanguageIDs)
Adds a Feature to this ResultSpecification for the specified languages. |
void |
addResultType(String aTypeName,
boolean aAllAnnotatorFeatures)
Adds an Type to this ResultSpecification for the language x-unspecified. |
void |
addResultType(String aTypeName,
boolean aAllAnnotatorFeatures,
String[] aLanguageIDs)
Adds an Type to this ResultSpecification for the specified languages. |
void |
addResultTypeOrFeature(TypeOrFeature aTypeOrFeature)
Adds a Result Type or Feature to this ResultSpecification for the language
x-unspecified. |
void |
addResultTypeOrFeature(TypeOrFeature aTypeOrFeature,
String[] aLanguageIDs)
Adds a Result Type or Feature to this ResultSpecification for the specified
languages. |
Object |
clone()
create a copy of the current object |
void |
compile(TypeSystem aTypeSystem)
Compiles this ResultSpecification using a specific TypeSystem . |
boolean |
containsFeature(String aFullFeatureName)
Determines whether this ResultSpecification contains the specified Feature for
the language x-unspecified. |
boolean |
containsFeature(String aFullFeatureName,
String aLanguage)
Determines whether this ResultSpecification contains the specified Feature for
the specified language. |
boolean |
containsType(String aTypeName)
Determines whether this ResultSpecification contains the specified Type for the
language x-unspecified. |
boolean |
containsType(String aTypeName,
String aLanguage)
Determines whether this ResultSpecification contains the specified Type for the
specified language |
TypeOrFeature[] |
getResultTypesAndFeatures()
Retrieves the Types and Features that the AnalysisEngine or Annotator is requested to produce for the default language x-unspecified. |
TypeOrFeature[] |
getResultTypesAndFeatures(String language)
Retrieves the Types and Features that the AnalysisEngine or Annotator is requested to produce for the specified language. |
void |
removeTypeOrFeature(TypeOrFeature aTypeOrFeature)
removes the specified TypeOrFeature from this ResultSpecification . |
void |
setResultTypesAndFeatures(TypeOrFeature[] aTypesAndFeatures)
Sets the Types and Features that the AnalysisEngine or Annotator is requested to produce for the language x-unspecified. |
void |
setResultTypesAndFeatures(TypeOrFeature[] aTypesAndFeatures,
String[] aLanguageIDs)
Sets the Types and Features that the AnalysisEngine or Annotator is requested to produce for the specified languages. |
Methods inherited from interface org.apache.uima.util.XMLizable |
---|
buildFromXMLElement, buildFromXMLElement, toXML, toXML, toXML, toXML |
Method Detail |
---|
TypeOrFeature[] getResultTypesAndFeatures()
TypeOrFeature
objects that define the result types and features for
the language x-unspecified.TypeOrFeature[] getResultTypesAndFeatures(String language)
TypeOrFeature
objects that define the result types and features for
the specified language.void setResultTypesAndFeatures(TypeOrFeature[] aTypesAndFeatures)
aTypesAndFeatures
- an array of TypeOrFeature
objects that define the result types and features
for the language x-unspecified.void setResultTypesAndFeatures(TypeOrFeature[] aTypesAndFeatures, String[] aLanguageIDs)
aTypesAndFeatures
- an array of TypeOrFeature
objects that define the result types and features
for the specified languages.aLanguageIDs
- an array of ISO language identifiers.void addResultTypeOrFeature(TypeOrFeature aTypeOrFeature)
ResultSpecification
for the language
x-unspecified. If the current ToF is already contained in the result spec, the language
specification for this ToF will be replaced with x-unspecified.
aTypeOrFeature
- the Type or Feature to add for the language x-unspecifiedvoid addResultTypeOrFeature(TypeOrFeature aTypeOrFeature, String[] aLanguageIDs)
ResultSpecification
for the specified
languages. If the current ToF is already contained in the result spec, the language
specification for this ToF will be replaced with the specified languages.
aTypeOrFeature
- the Type or Feature to add for the specified languagesaLanguageIDs
- an array of ISO language identifiers.void addResultType(String aTypeName, boolean aAllAnnotatorFeatures)
ResultSpecification
for the language x-unspecified.
If the current Type is already contained in the result spec, the language specification for
this Type will be replaced with x-unspecified.
aTypeName
- the name of the Type to add for the language x-unspecifiedaAllAnnotatorFeatures
- whether all features of this type should also be producedvoid addResultType(String aTypeName, boolean aAllAnnotatorFeatures, String[] aLanguageIDs)
ResultSpecification
for the specified languages.
If the given Type is already contained in the result spec, the languages specificied will be
added to those already associated with the Type in this ResultSpec.
aTypeName
- the name of the Type to add for the specified languagesaAllAnnotatorFeatures
- whether all features of this type should also be producedaLanguageIDs
- an array of ISO language identifiers.void addResultFeature(String aFullFeatureName)
ResultSpecification
for the language x-unspecified.
If the given Type is already contained in the result spec, the languages specificied will be
added to those already associated with the Type in this ResultSpec.
aFullFeatureName
- the fully-qualified name of the Feature to add for the language x-unspecifiedvoid addResultFeature(String aFullFeatureName, String[] aLanguageIDs)
ResultSpecification
for the specified languages.
If the current Feature is already contained in the result spec, the language specification for
this Feature will be replaced with the specified languages.
aFullFeatureName
- the fully-qualified name of the Feature to add for the specified languagesaLanguageIDs
- an array of ISO language identifiers.void compile(TypeSystem aTypeSystem)
ResultSpecification
using a specific TypeSystem
. This
allows the containsType(String)
and containsFeature(String)
methods to
properly consider the inheritance of types and to expand features when this
ResultSpecification
contains Types with allAnnotatorFeatures
set
to true.
This method is called automatically by the Analysis Engine. Annotators and Applications do not need to call it.
aTypeSystem
- the Type System used to determine which features belong to each Typeboolean containsType(String aTypeName)
ResultSpecification
contains the specified Type for the
language x-unspecified.
aTypeName
- the name of the type
ResultSpecification
contains the type with name
aTypeName
.boolean containsType(String aTypeName, String aLanguage)
ResultSpecification
contains the specified Type for the
specified language
aTypeName
- the name of the typeaLanguage
- the language to search for
ResultSpecification
contains the type with name
aTypeName
for the specified language.boolean containsFeature(String aFullFeatureName)
ResultSpecification
contains the specified Feature for
the language x-unspecified.
aFullFeatureName
- the fully-qualified name of the feature, in the form MyTypeName:MyFeatureName.
ResultSpecification
contains the feature with
name aFullFeatureName
.boolean containsFeature(String aFullFeatureName, String aLanguage)
ResultSpecification
contains the specified Feature for
the specified language.
aFullFeatureName
- the fully-qualified name of the feature, in the form MyTypeName:MyFeatureName.aLanguage
- the language to search for
ResultSpecification
contains the feature with
name aFullFeatureName
for the specified language.void addCapabilities(Capability[] aCapabilities)
ResultSpecification
.
aCapabilities
- capabilities to addvoid addCapabilities(Capability[] aCapabilities, boolean aOutputs)
ResultSpecification
.
aCapabilities
- capabilities to addaOutputs
- true to add the output types/features to this ResultSpecification, false to add the
input types/features to this ResultSpecification.void removeTypeOrFeature(TypeOrFeature aTypeOrFeature)
ResultSpecification
.
aTypeOrFeature
- the Type or Feature to removeObject clone()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |