public class CPMUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
CPM_LOG_RESOURCE_BUNDLE
The Constant CPM_LOG_RESOURCE_BUNDLE.
|
| Constructor and Description |
|---|
CPMUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
convertToAbsolutePath(String aSystemVar,
String aExpr,
String aPathToConvert)
Convert to absolute path.
|
static void |
dumpEvents(org.apache.uima.util.ProcessTrace aPTr)
Dumps all events in the process trace object.
|
static long |
extractTime(org.apache.uima.util.ProcessTrace aPT,
String eventName)
Returns the total duration of a given event.
|
static File |
findDeployDirectory(String aServiceName)
Find deploy directory.
|
static ChunkMetadata |
getChunkMetadata(org.apache.uima.cas.CAS aCas)
Extract metadata associated with chunk from a given CAS.
|
static int |
getFeatureAsInt(org.apache.uima.cas.CAS aCas,
org.apache.uima.cas.Feature aFeature,
String aName)
Gets the feature as int.
|
static String |
getFeatureAsString(org.apache.uima.cas.CAS aCas,
org.apache.uima.cas.Feature aFeature,
String aName)
Returns a value associated with a given feature.
|
static String[] |
getKeys2Drop(String aKeyDropMapFile)
Currently, this returns initialized array of Strings.
|
static org.apache.uima.util.UimaTimer |
getTimer()
Gets the timer.
|
static org.apache.uima.util.UimaTimer |
getTimer(String aTimerClass)
Return timer to measure performace of the cpm.
|
static String |
scrubThePath(String value)
Finds an occurance of the ##CPM_HOME in a value parameter and returns it with an expanded form
(ie.c:/cpm/...) based on the env variable CPM_HOME.
|
static void |
setTimer(org.apache.uima.util.UimaTimer aTimer)
Sets the timer.
|
public static final String CPM_LOG_RESOURCE_BUNDLE
public static String[] getKeys2Drop(String aKeyDropMapFile) throws org.apache.uima.resource.ResourceConfigurationException
aKeyDropMapFile - -
a file containing a list of features that should be removed from CAS being sent to Cas
Processor. Currently not used.org.apache.uima.resource.ResourceConfigurationException - -public static void setTimer(org.apache.uima.util.UimaTimer aTimer)
aTimer - the new timerpublic static org.apache.uima.util.UimaTimer getTimer()
public static String convertToAbsolutePath(String aSystemVar, String aExpr, String aPathToConvert)
aSystemVar - the a system varaExpr - the a expraPathToConvert - the a path to convertpublic static org.apache.uima.util.UimaTimer getTimer(String aTimerClass) throws Exception
aTimerClass - the a timer classException - -public static long extractTime(org.apache.uima.util.ProcessTrace aPT,
String eventName)
aPT - -
Event containereventName - -
name of the event for which the time is neededpublic static void dumpEvents(org.apache.uima.util.ProcessTrace aPTr)
aPTr - -
event containerpublic static String scrubThePath(String value)
value - the valuepublic static File findDeployDirectory(String aServiceName) throws Exception
aServiceName - the a service nameException - -public static int getFeatureAsInt(org.apache.uima.cas.CAS aCas,
org.apache.uima.cas.Feature aFeature,
String aName)
throws Exception
aCas - the a casaFeature - the a featureaName - the a nameException - the exceptionpublic static String getFeatureAsString(org.apache.uima.cas.CAS aCas, org.apache.uima.cas.Feature aFeature, String aName) throws Exception
aCas - -
Cas containing data to extractaFeature - -
feature to locate in the CASaName - -
name of the featureException - the exceptionpublic static ChunkMetadata getChunkMetadata(org.apache.uima.cas.CAS aCas)
aCas - -
Cas to extract chunk metadata fromCopyright © 2006–2017 The Apache Software Foundation. All rights reserved.