Moreover, it gives access to the logging facility to be used by Annotators. AnnotatorContext
defines various extractValue
and assignValue
methods. These methods are used by the application and annotators to access (or change) configuration parameter values.
Public Types | |
typedef std::map < icu::UnicodeString, AnnotatorContext * > | TyMapDelegateAnCs |
typedef std::map < icu::UnicodeString, SofaID * > | TyMapSofaMappings |
Public Member Functions | |
AnnotatorContext (void) | |
AnnotatorContext (AnalysisEngineDescription *taeSpec) | |
Note: This object will NOT assume memory ownership of taeSpec . | |
~AnnotatorContext (void) | |
const SofaID & | mapToSofaID (const icu::UnicodeString &componentSofaName) |
Use this method to obtain a SofaID which is a handle to a Sofa in the CAS. | |
TyMapSofaMappings | getSofaMappings () const |
Returns the component sofaname to absolute sofa name mapping for this context. | |
TyErrorId | defineCASPool (size_t numInstances) |
Defines the CAS pool that this AnnotatorContext must support. | |
CAS & | getEmptyCAS () |
Returns an empty CAS from the CASPool. | |
void | releaseCAS (CAS &) |
Return the CAS to the pool. | |
void | release (std::string &value) const |
Release contents of string container filled by extractValue. | |
void | release (std::vector< std::string * > &returnValues) const |
Release contents of vector container filled by extractValue. | |
bool | isParameterDefined (const icu::UnicodeString ¶mName) const |
Returns true iff the parameter paramName is defined for this TAE specifier. | |
bool | isParameterDefined (const icu::UnicodeString &groupName, const icu::UnicodeString ¶mName) const |
Returns true iff the parameter paramName is defined in the group groupName for this TAE specifier. | |
const AnalysisEngineDescription & | getTaeSpecifier () const |
Returns this AnC's AnalysisEngineDescription. | |
AnnotatorContext * | getDelegate (const icu::UnicodeString &key) const |
Returns NULL if no delegate for key can be found. | |
AnnotatorContext * | extractDelegate (const icu::UnicodeString &key) |
Returns NULL if no delegate for key can be found. | |
const TyMapDelegateAnCs & | getDelegates () const |
Returns the delegates of this AnnotatorContext. | |
LogFacility & | getLogger () const |
returns the LogFacility to be used for logging | |
size_t | getTraceCompId () const |
const AnalysisEngineMetaData::TyVecpFSIndexDescriptions | getFSIndexDescriptions () const |
returns the index descriptions of this AnnotatorContext and all of its delegates | |
const std::set < icu::UnicodeString > | getGroupNamesForParameter (const icu::UnicodeString ¶mName) const |
TyErrorId | extractValue (const icu::UnicodeString ¶mName, std::string &value) const |
Return string config params as UTF-8--should be only if you know this is will work with you are dealing with single byte char set. | |
TyErrorId | extractValue (const icu::UnicodeString ¶mName, std::vector< std::string * > &returnValues) const |
returns string parameter values as UTF-8 string Caller assumes ownership of objects in the vector | |
TyErrorId | extractValue (const icu::UnicodeString &groupName, const icu::UnicodeString ¶mName, std::string &value) const |
TyErrorId | extractValue (const icu::UnicodeString &groupName, const icu::UnicodeString ¶mName, std::vector< std::string * > &returnValues) const |
returns string parameter values as UTF-8 string Caller assumes ownership of objects in the vector | |
Getters for Configuration Parameter Values | |
These getters should be used as follows:
paramName . If not, they return an error code. In this case, the value parameter passed into the method is not changed. If the AnnotatorContext | |
TyErrorId | extractValue (const icu::UnicodeString ¶mName, bool &value) const |
inline AnnotatorContext::AnnotatorContext(void) {} | |
TyErrorId | extractValue (const icu::UnicodeString ¶mName, std::vector< bool > &returnValues) const |
TyErrorId | extractValue (const icu::UnicodeString ¶mName, int &value) const |
TyErrorId | extractValue (const icu::UnicodeString ¶mName, size_t &value) const |
TyErrorId | extractValue (const icu::UnicodeString ¶mName, std::vector< int > &returnValues) const |
TyErrorId | extractValue (const icu::UnicodeString ¶mName, float &value) const |
TyErrorId | extractValue (const icu::UnicodeString ¶mName, std::vector< float > &returnValues) const |
TyErrorId | extractValue (const icu::UnicodeString ¶mName, icu::UnicodeString &value) const |
TyErrorId | extractValue (const icu::UnicodeString ¶mName, std::vector< icu::UnicodeString > &returnValues) const |
TyErrorId | extractValue (const icu::UnicodeString &groupName, const icu::UnicodeString ¶mName, bool &value) const |
TyErrorId | extractValue (const icu::UnicodeString &groupName, const icu::UnicodeString ¶mName, std::vector< bool > &returnValues) const |
TyErrorId | extractValue (const icu::UnicodeString &groupName, const icu::UnicodeString ¶mName, int &value) const |
TyErrorId | extractValue (const icu::UnicodeString &groupName, const icu::UnicodeString ¶mName, size_t &value) const |
TyErrorId | extractValue (const icu::UnicodeString &groupName, const icu::UnicodeString ¶mName, std::vector< int > &returnValues) const |
TyErrorId | extractValue (const icu::UnicodeString &groupName, const icu::UnicodeString ¶mName, float &value) const |
TyErrorId | extractValue (const icu::UnicodeString &groupName, const icu::UnicodeString ¶mName, std::vector< float > &returnValues) const |
TyErrorId | extractValue (const icu::UnicodeString &groupName, const icu::UnicodeString ¶mName, icu::UnicodeString &value) const |
TyErrorId | extractValue (const icu::UnicodeString &groupName, const icu::UnicodeString ¶mName, std::vector< icu::UnicodeString > &returnValues) const |
Setters for Configuration Parameter Values | |
These setters should be used as follows:
paramName . If not, they return an error code. If the TyErrorId returned is not UIMA_ERR_NONE, the value of the configuration parameter will not have been changed. | |
TyErrorId | assignValue (const icu::UnicodeString ¶mName, const bool &value) |
TyErrorId | assignValue (const icu::UnicodeString ¶mName, const std::vector< bool > &value) |
TyErrorId | assignValue (const icu::UnicodeString ¶mName, const size_t &value) |
TyErrorId | assignValue (const icu::UnicodeString ¶mName, const std::vector< size_t > &value) |
TyErrorId | assignValue (const icu::UnicodeString ¶mName, const int &value) |
TyErrorId | assignValue (const icu::UnicodeString ¶mName, const std::vector< int > &value) |
TyErrorId | assignValue (const icu::UnicodeString ¶mName, const float &value) |
TyErrorId | assignValue (const icu::UnicodeString ¶mName, const std::vector< float > &value) |
TyErrorId | assignValue (const icu::UnicodeString ¶mName, const double &value) |
TyErrorId | assignValue (const icu::UnicodeString ¶mName, const std::vector< double > &value) |
TyErrorId | assignValue (const icu::UnicodeString ¶mName, const icu::UnicodeString &value) |
TyErrorId | assignValue (const icu::UnicodeString ¶mName, const std::vector< icu::UnicodeString > &value) |
TyErrorId | assignValue (const icu::UnicodeString &groupName, const icu::UnicodeString ¶mName, const bool &value) |
TyErrorId | assignValue (const icu::UnicodeString &groupName, const icu::UnicodeString ¶mName, const std::vector< bool > &value) |
TyErrorId | assignValue (const icu::UnicodeString &groupName, const icu::UnicodeString ¶mName, const int &value) |
TyErrorId | assignValue (const icu::UnicodeString &groupName, const icu::UnicodeString ¶mName, const std::vector< int > &value) |
TyErrorId | assignValue (const icu::UnicodeString &groupName, const icu::UnicodeString ¶mName, const size_t &value) |
TyErrorId | assignValue (const icu::UnicodeString &groupName, const icu::UnicodeString ¶mName, const std::vector< size_t > &value) |
TyErrorId | assignValue (const icu::UnicodeString &groupName, const icu::UnicodeString ¶mName, const float &value) |
TyErrorId | assignValue (const icu::UnicodeString &groupName, const icu::UnicodeString ¶mName, const std::vector< float > &value) |
TyErrorId | assignValue (const icu::UnicodeString &groupName, const icu::UnicodeString ¶mName, const double &value) |
TyErrorId | assignValue (const icu::UnicodeString &groupName, const icu::UnicodeString ¶mName, const std::vector< double > &value) |
TyErrorId | assignValue (const icu::UnicodeString &groupName, const icu::UnicodeString ¶mName, const icu::UnicodeString &value) |
TyErrorId | assignValue (const icu::UnicodeString &groupName, const icu::UnicodeString ¶mName, const std::vector< icu::UnicodeString > &value) |
typedef std::map< icu::UnicodeString, AnnotatorContext * > uima::AnnotatorContext::TyMapDelegateAnCs |
typedef std::map< icu::UnicodeString, SofaID * > uima::AnnotatorContext::TyMapSofaMappings |
uima::AnnotatorContext::AnnotatorContext | ( | void | ) | [inline] |
uima::AnnotatorContext::AnnotatorContext | ( | AnalysisEngineDescription * | taeSpec | ) |
Note: This object will NOT assume memory ownership of taeSpec
.
It is the responsibility of the caller to delete taeSpec
.
uima::AnnotatorContext::~AnnotatorContext | ( | void | ) |
TyErrorId uima::AnnotatorContext::extractValue | ( | const icu::UnicodeString & | paramName, | |
std::string & | value | |||
) | const [inline] |
Return string config params as UTF-8--should be only if you know this is will work with you are dealing with single byte char set.
References uima::NameValuePair::extractSingleByteStringValue(), UIMA_ERR_CONFIG_NAME_VALUE_PAIR_NOT_FOUND, and UIMA_ERR_NONE.
TyErrorId uima::AnnotatorContext::extractValue | ( | const icu::UnicodeString & | paramName, | |
std::vector< std::string * > & | returnValues | |||
) | const [inline] |
returns string parameter values as UTF-8 string Caller assumes ownership of objects in the vector
References uima::NameValuePair::extractSingleByteStringValues(), UIMA_ERR_CONFIG_NAME_VALUE_PAIR_NOT_FOUND, and UIMA_ERR_NONE.
TyErrorId uima::AnnotatorContext::extractValue | ( | const icu::UnicodeString & | groupName, | |
const icu::UnicodeString & | paramName, | |||
std::string & | value | |||
) | const [inline] |
TyErrorId uima::AnnotatorContext::extractValue | ( | const icu::UnicodeString & | groupName, | |
const icu::UnicodeString & | paramName, | |||
std::vector< std::string * > & | returnValues | |||
) | const [inline] |
returns string parameter values as UTF-8 string Caller assumes ownership of objects in the vector
References uima::NameValuePair::extractSingleByteStringValues(), uima::AnalysisEngineDescription::getSearchStrategy(), UIMA_ERR_CONFIG_NAME_VALUE_PAIR_NOT_FOUND, and UIMA_ERR_NONE.
const SofaID& uima::AnnotatorContext::mapToSofaID | ( | const icu::UnicodeString & | componentSofaName | ) | [inline] |
Use this method to obtain a SofaID which is a handle to a Sofa in the CAS.
This method looks up the SofaID in the Sofa name mapping provided for this AnalysisEngine. If there is no mapping for the specified Sofa name, it maps to itself. Note: This AnnotatorContext still has memory ownership of the returned object.
References uima::SofaID::getComponentSofaName(), uima::SofaID::setComponentSofaName(), and uima::SofaID::setSofaId().
TyMapSofaMappings uima::AnnotatorContext::getSofaMappings | ( | ) | const [inline] |
Returns the component sofaname to absolute sofa name mapping for this context.
Note: This AnnotatorContext still has memory ownership of the returned object.
TyErrorId uima::AnnotatorContext::defineCASPool | ( | size_t | numInstances | ) |
Defines the CAS pool that this AnnotatorContext must support.
This method must be called before AnnotatorContext#getEmptyCAS() may be called. A CASPool is defined by the framework when the components getCASInstancesRequired() returns a value greater than 0,
CAS& uima::AnnotatorContext::getEmptyCAS | ( | ) |
Returns an empty CAS from the CASPool.
This AnnotatorContext retains ownership of the CAS instance. To return the CAS to the pool, call releaseCAS.
void uima::AnnotatorContext::releaseCAS | ( | CAS & | ) |
Return the CAS to the pool.
This will first call CAS.reset().
TyErrorId uima::AnnotatorContext::extractValue | ( | const icu::UnicodeString & | paramName, | |
bool & | value | |||
) | const [inline] |
TyErrorId uima::AnnotatorContext::extractValue | ( | const icu::UnicodeString & | paramName, | |
std::vector< bool > & | returnValues | |||
) | const [inline] |
TyErrorId uima::AnnotatorContext::extractValue | ( | const icu::UnicodeString & | paramName, | |
int & | value | |||
) | const [inline] |
TyErrorId uima::AnnotatorContext::extractValue | ( | const icu::UnicodeString & | paramName, | |
size_t & | value | |||
) | const [inline] |
TyErrorId uima::AnnotatorContext::extractValue | ( | const icu::UnicodeString & | paramName, | |
std::vector< int > & | returnValues | |||
) | const [inline] |
TyErrorId uima::AnnotatorContext::extractValue | ( | const icu::UnicodeString & | paramName, | |
float & | value | |||
) | const [inline] |
TyErrorId uima::AnnotatorContext::extractValue | ( | const icu::UnicodeString & | paramName, | |
std::vector< float > & | returnValues | |||
) | const [inline] |
TyErrorId uima::AnnotatorContext::extractValue | ( | const icu::UnicodeString & | paramName, | |
icu::UnicodeString & | value | |||
) | const [inline] |
TyErrorId uima::AnnotatorContext::extractValue | ( | const icu::UnicodeString & | paramName, | |
std::vector< icu::UnicodeString > & | returnValues | |||
) | const [inline] |
TyErrorId uima::AnnotatorContext::extractValue | ( | const icu::UnicodeString & | groupName, | |
const icu::UnicodeString & | paramName, | |||
bool & | value | |||
) | const [inline] |
TyErrorId uima::AnnotatorContext::extractValue | ( | const icu::UnicodeString & | groupName, | |
const icu::UnicodeString & | paramName, | |||
std::vector< bool > & | returnValues | |||
) | const [inline] |
TyErrorId uima::AnnotatorContext::extractValue | ( | const icu::UnicodeString & | groupName, | |
const icu::UnicodeString & | paramName, | |||
int & | value | |||
) | const [inline] |
TyErrorId uima::AnnotatorContext::extractValue | ( | const icu::UnicodeString & | groupName, | |
const icu::UnicodeString & | paramName, | |||
size_t & | value | |||
) | const [inline] |
TyErrorId uima::AnnotatorContext::extractValue | ( | const icu::UnicodeString & | groupName, | |
const icu::UnicodeString & | paramName, | |||
std::vector< int > & | returnValues | |||
) | const [inline] |
TyErrorId uima::AnnotatorContext::extractValue | ( | const icu::UnicodeString & | groupName, | |
const icu::UnicodeString & | paramName, | |||
float & | value | |||
) | const [inline] |
TyErrorId uima::AnnotatorContext::extractValue | ( | const icu::UnicodeString & | groupName, | |
const icu::UnicodeString & | paramName, | |||
std::vector< float > & | returnValues | |||
) | const [inline] |
TyErrorId uima::AnnotatorContext::extractValue | ( | const icu::UnicodeString & | groupName, | |
const icu::UnicodeString & | paramName, | |||
icu::UnicodeString & | value | |||
) | const [inline] |
TyErrorId uima::AnnotatorContext::extractValue | ( | const icu::UnicodeString & | groupName, | |
const icu::UnicodeString & | paramName, | |||
std::vector< icu::UnicodeString > & | returnValues | |||
) | const [inline] |
void uima::AnnotatorContext::release | ( | std::string & | value | ) | const |
Release contents of string container filled by extractValue.
Useful when caller and callee use different heaps, e.g. when debug code uses a release library.
void uima::AnnotatorContext::release | ( | std::vector< std::string * > & | returnValues | ) | const |
Release contents of vector container filled by extractValue.
Useful when caller and callee use different heaps, e.g. when debug code uses a release library.
bool uima::AnnotatorContext::isParameterDefined | ( | const icu::UnicodeString & | paramName | ) | const |
Returns true iff the parameter paramName is defined for this TAE specifier.
bool uima::AnnotatorContext::isParameterDefined | ( | const icu::UnicodeString & | groupName, | |
const icu::UnicodeString & | paramName | |||
) | const |
Returns true iff the parameter paramName is defined in the group groupName for this TAE specifier.
const AnalysisEngineDescription& uima::AnnotatorContext::getTaeSpecifier | ( | ) | const [inline] |
AnnotatorContext* uima::AnnotatorContext::getDelegate | ( | const icu::UnicodeString & | key | ) | const |
Returns NULL if no delegate for key can be found.
Note: This AnnotatorContext still has memory ownership of the returned object.
AnnotatorContext* uima::AnnotatorContext::extractDelegate | ( | const icu::UnicodeString & | key | ) |
Returns NULL if no delegate for key can be found.
NOTE: This AnnotatorContext will transfer memory ownership of the returned object to the caller. The returned object is removed from the list of delegate AnnotatorContexts
const TyMapDelegateAnCs& uima::AnnotatorContext::getDelegates | ( | ) | const [inline] |
Returns the delegates of this AnnotatorContext.
Each delegate is mapped to a unique key. Note: This AnnotatorContext still has memory ownership of the returned objects.
LogFacility& uima::AnnotatorContext::getLogger | ( | ) | const [inline] |
size_t uima::AnnotatorContext::getTraceCompId | ( | ) | const [inline] |
References UIMA_TRACE_COMPID_ANNOTATOR_DEFAULT.
const AnalysisEngineMetaData::TyVecpFSIndexDescriptions uima::AnnotatorContext::getFSIndexDescriptions | ( | ) | const |
returns the index descriptions of this AnnotatorContext and all of its delegates
const std::set<icu::UnicodeString> uima::AnnotatorContext::getGroupNamesForParameter | ( | const icu::UnicodeString & | paramName | ) | const |
paramName
. This includes the groups in this AnC and all its parents. Calls to extractValue
for each of these group names will succeed (albeit it is not guarenteed that each call will return a value). If the AnC doesn't contain groups, but defines the parameter, a special group name will be returned that can be used in the calls to extractValue
. In this case, no group names of any parents will be included in the result, as extractValue
on this AnC with these group names would fail. TyErrorId uima::AnnotatorContext::assignValue | ( | const icu::UnicodeString & | paramName, | |
const bool & | value | |||
) |
TyErrorId uima::AnnotatorContext::assignValue | ( | const icu::UnicodeString & | paramName, | |
const std::vector< bool > & | value | |||
) |
TyErrorId uima::AnnotatorContext::assignValue | ( | const icu::UnicodeString & | paramName, | |
const size_t & | value | |||
) |
TyErrorId uima::AnnotatorContext::assignValue | ( | const icu::UnicodeString & | paramName, | |
const std::vector< size_t > & | value | |||
) |
TyErrorId uima::AnnotatorContext::assignValue | ( | const icu::UnicodeString & | paramName, | |
const int & | value | |||
) |
TyErrorId uima::AnnotatorContext::assignValue | ( | const icu::UnicodeString & | paramName, | |
const std::vector< int > & | value | |||
) |
TyErrorId uima::AnnotatorContext::assignValue | ( | const icu::UnicodeString & | paramName, | |
const float & | value | |||
) |
TyErrorId uima::AnnotatorContext::assignValue | ( | const icu::UnicodeString & | paramName, | |
const std::vector< float > & | value | |||
) |
TyErrorId uima::AnnotatorContext::assignValue | ( | const icu::UnicodeString & | paramName, | |
const double & | value | |||
) |
TyErrorId uima::AnnotatorContext::assignValue | ( | const icu::UnicodeString & | paramName, | |
const std::vector< double > & | value | |||
) |
TyErrorId uima::AnnotatorContext::assignValue | ( | const icu::UnicodeString & | paramName, | |
const icu::UnicodeString & | value | |||
) |
TyErrorId uima::AnnotatorContext::assignValue | ( | const icu::UnicodeString & | paramName, | |
const std::vector< icu::UnicodeString > & | value | |||
) |
TyErrorId uima::AnnotatorContext::assignValue | ( | const icu::UnicodeString & | groupName, | |
const icu::UnicodeString & | paramName, | |||
const bool & | value | |||
) |
TyErrorId uima::AnnotatorContext::assignValue | ( | const icu::UnicodeString & | groupName, | |
const icu::UnicodeString & | paramName, | |||
const std::vector< bool > & | value | |||
) |
TyErrorId uima::AnnotatorContext::assignValue | ( | const icu::UnicodeString & | groupName, | |
const icu::UnicodeString & | paramName, | |||
const int & | value | |||
) |
TyErrorId uima::AnnotatorContext::assignValue | ( | const icu::UnicodeString & | groupName, | |
const icu::UnicodeString & | paramName, | |||
const std::vector< int > & | value | |||
) |
TyErrorId uima::AnnotatorContext::assignValue | ( | const icu::UnicodeString & | groupName, | |
const icu::UnicodeString & | paramName, | |||
const size_t & | value | |||
) |
TyErrorId uima::AnnotatorContext::assignValue | ( | const icu::UnicodeString & | groupName, | |
const icu::UnicodeString & | paramName, | |||
const std::vector< size_t > & | value | |||
) |
TyErrorId uima::AnnotatorContext::assignValue | ( | const icu::UnicodeString & | groupName, | |
const icu::UnicodeString & | paramName, | |||
const float & | value | |||
) |
TyErrorId uima::AnnotatorContext::assignValue | ( | const icu::UnicodeString & | groupName, | |
const icu::UnicodeString & | paramName, | |||
const std::vector< float > & | value | |||
) |
TyErrorId uima::AnnotatorContext::assignValue | ( | const icu::UnicodeString & | groupName, | |
const icu::UnicodeString & | paramName, | |||
const double & | value | |||
) |
TyErrorId uima::AnnotatorContext::assignValue | ( | const icu::UnicodeString & | groupName, | |
const icu::UnicodeString & | paramName, | |||
const std::vector< double > & | value | |||
) |
TyErrorId uima::AnnotatorContext::assignValue | ( | const icu::UnicodeString & | groupName, | |
const icu::UnicodeString & | paramName, | |||
const icu::UnicodeString & | value | |||
) |
TyErrorId uima::AnnotatorContext::assignValue | ( | const icu::UnicodeString & | groupName, | |
const icu::UnicodeString & | paramName, | |||
const std::vector< icu::UnicodeString > & | value | |||
) |