Package org.apache.uima.uimacpp
Class UimacppEngine
java.lang.Object
org.apache.uima.uimacpp.UimacppEngine
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
(package private) CAS
private static String[]
(package private) long
this field is the physical pointer to the C++ TafClEngine object this TafWrapper object is associated with.private static final int
(package private) boolean
private static final int
private static final int
private static final int
private static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
batchProcessCompleteprivate void
void
CasConsumer collectionProcessCompleteprivate void
static void
configureResourceManager
(String workDirectory, String dataDirectory) Configure the TAF Resource Manager.private static void
configureResourceManagerJNI
(String workDir, String dataDir) private void
static UimacppEngine
createJTafTAE
(String configFile) create a TAF engine with a config fileprivate static void
Create the TAF resource manager.private static void
void
destroy()
de-initializes the TAF engine.private void
private void
private void
fillCASJNI
(int[] heapArray, int[] fsIndex, String[] stringTable, byte[] byteArray, short[] shortArray, long[] longArray) protected void
finalize()
static String
getErrorMessage
(long errorCode) helper function to get the error message for some TAF error ID.private static String
getErrorMessageJNI
(long errorId) private Object
getSerializedDataJNI
(int what) private Object
getSerializedSegmentDataJNI
(int what) static String
helper function to get the TAF JNI version.private static String
boolean
hasNext()
hasNextprivate boolean
(package private) void
initialize
(String config) initialize Taf engineprivate void
initializeJNI
(String configFile) void
nextprivate void
(package private) static void
printArray
(String s, int[] ar) (package private) static void
printArray
(String s, String[] ar) void
process
(ResultSpecification rs, CAS aCas, boolean casIsEmpty) process the document.private void
processJNI
(int isTCas, String sofaName, int[] resultSpecTypes, int[] resultSpecFeatures) private void
private void
resetJNI()
private void
serializeCASJNI
(boolean bSerializeData) private static void
serializeResultSpecification
(ResultSpecification rs, CASImpl cas, IntVector resultSpecTypes, IntVector resultSpecFeatures) private void
serializeSegmentJNI
(boolean bSerializeData) (package private) static void
(package private) void
typeSystemInit
(CASMgrSerializer casMgrSerializer) reinit Taf engine type systemprivate void
typeSystemInitJNI
(String[] typeNames, String[] featureNames, int[] typeInheritance, int[] featDecls, int topTypeCode, int[] featureOffsets, int[] typeOrder, int[] stringSubTypes, String[] stringSubTypeValues, int[] stringSubTypeValuePos, String[] indexNames, int[] nameToIndexMap, int[] indexingStrategy, int[] comparatorIndex, int[] comparators)
-
Field Details
-
compatibleTafJniVersions
-
cppEnginePointer
long cppEnginePointerthis field is the physical pointer to the C++ TafClEngine object this TafWrapper object is associated with. Do not use explicitly anywhere. It is set automatically by theconstructorJNI()
method and set to 0 by thedestructorJNI()
method. -
cas
CAS cas -
hasNext
boolean hasNext -
FSHEAP
private static final int FSHEAP- See Also:
-
STRINGSYMBOL
private static final int STRINGSYMBOL- See Also:
-
INDEXEDFSS
private static final int INDEXEDFSS- See Also:
-
BYTEHEAP
private static final int BYTEHEAP- See Also:
-
SHORTHEAP
private static final int SHORTHEAP- See Also:
-
LONGHEAP
private static final int LONGHEAP- See Also:
-
-
Constructor Details
-
UimacppEngine
- Throws:
UimacppException
-
-
Method Details
-
createResourceManagerJNI
- Throws:
InternalTafException
-
configureResourceManagerJNI
private static void configureResourceManagerJNI(String workDir, String dataDir) throws InternalTafException - Throws:
InternalTafException
-
constructorJNI
- Throws:
InternalTafException
-
destructorJNI
- Throws:
InternalTafException
-
initializeJNI
- Throws:
InternalTafException
-
typeSystemInitJNI
private void typeSystemInitJNI(String[] typeNames, String[] featureNames, int[] typeInheritance, int[] featDecls, int topTypeCode, int[] featureOffsets, int[] typeOrder, int[] stringSubTypes, String[] stringSubTypeValues, int[] stringSubTypeValuePos, String[] indexNames, int[] nameToIndexMap, int[] indexingStrategy, int[] comparatorIndex, int[] comparators) throws InternalTafException - Throws:
InternalTafException
-
destroyJNI
- Throws:
InternalTafException
-
resetJNI
- Throws:
InternalTafException
-
fillCASJNI
private void fillCASJNI(int[] heapArray, int[] fsIndex, String[] stringTable, byte[] byteArray, short[] shortArray, long[] longArray) -
processJNI
private void processJNI(int isTCas, String sofaName, int[] resultSpecTypes, int[] resultSpecFeatures) throws InternalTafException - Throws:
InternalTafException
-
serializeCASJNI
- Throws:
InternalTafException
-
getSerializedDataJNI
- Throws:
InternalTafException
-
batchProcessCompleteJNI
- Throws:
InternalTafException
-
collectionProcessCompleteJNI
- Throws:
InternalTafException
-
hasNextSegmentJNI
- Throws:
InternalTafException
-
nextSegmentJNI
- Throws:
InternalTafException
-
serializeSegmentJNI
- Throws:
InternalTafException
-
getSerializedSegmentDataJNI
- Throws:
InternalTafException
-
releaseSegmentJNI
- Throws:
InternalTafException
-
getErrorMessageJNI
- Throws:
InternalTafException
-
getVersionJNI
- Throws:
InternalTafException
-
createResourceManager
Create the TAF resource manager.- Throws:
UimacppException
-
configureResourceManager
public static void configureResourceManager(String workDirectory, String dataDirectory) throws UimacppException Configure the TAF Resource Manager.- Parameters:
workDirectory
- the work directorydataDirectory
- the data directory- Throws:
UimacppException
- wraps any exception
-
createJTafTAE
create a TAF engine with a config file- Parameters:
configFile
- the configuration file used for initialization- Returns:
- a UimacppEngine
- Throws:
UimacppException
- pass thru
-
printArray
-
printArray
-
initialize
initialize Taf engine- Parameters:
configFile
- the configuration as a string (not a filename)- Throws:
UimacppException
-
typeSystemInit
reinit Taf engine type system- Parameters:
serialized
- CAS definition- Throws:
UimacppException
-
destroy
de-initializes the TAF engine.- Throws:
UimacppException
- wraps any exception
-
serializeResultSpecification
private static void serializeResultSpecification(ResultSpecification rs, CASImpl cas, IntVector resultSpecTypes, IntVector resultSpecFeatures) -
process
process the document.- Parameters:
rs
- the result specificationaCas
- the CAScasIsEmpty
- tbd- Throws:
UimacppException
- wraps any exception
-
hasNext
hasNext- Returns:
- true if there's a next element
- Throws:
UimacppException
- wraps any exception
-
next
next- Parameters:
segment
- tbd- Throws:
UimacppException
- wraps any exception
-
batchProcessComplete
batchProcessComplete- Throws:
UimacppException
- wraps any exception
-
collectionProcessComplete
CasConsumer collectionProcessComplete- Throws:
UimacppException
- wraps any exception
-
getErrorMessage
helper function to get the error message for some TAF error ID.- Parameters:
errorCode
- the code used as the key to look up the error message- Returns:
- the error message
- Throws:
UimacppException
- wraps any exception
-
getTafJNIVersion
helper function to get the TAF JNI version.- Returns:
- Taf JNI Version
- Throws:
UimacppException
- wraps any exception
-
throwJTafException
- Throws:
UimacppException
-
finalize
-