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) CASprivate static String[](package private) longthis field is the physical pointer to the C++ TafClEngine object this TafWrapper object is associated with.private static final int(package private) booleanprivate static final intprivate static final intprivate static final intprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbatchProcessCompleteprivate voidvoidCasConsumer collectionProcessCompleteprivate voidstatic voidconfigureResourceManager(String workDirectory, String dataDirectory) Configure the TAF Resource Manager.private static voidconfigureResourceManagerJNI(String workDir, String dataDir) private voidstatic UimacppEnginecreateJTafTAE(String configFile) create a TAF engine with a config fileprivate static voidCreate the TAF resource manager.private static voidvoiddestroy()de-initializes the TAF engine.private voidprivate voidprivate voidfillCASJNI(int[] heapArray, int[] fsIndex, String[] stringTable, byte[] byteArray, short[] shortArray, long[] longArray) protected voidfinalize()static StringgetErrorMessage(long errorCode) helper function to get the error message for some TAF error ID.private static StringgetErrorMessageJNI(long errorId) private ObjectgetSerializedDataJNI(int what) private ObjectgetSerializedSegmentDataJNI(int what) static Stringhelper function to get the TAF JNI version.private static StringbooleanhasNext()hasNextprivate boolean(package private) voidinitialize(String config) initialize Taf engineprivate voidinitializeJNI(String configFile) voidnextprivate void(package private) static voidprintArray(String s, int[] ar) (package private) static voidprintArray(String s, String[] ar) voidprocess(ResultSpecification rs, CAS aCas, boolean casIsEmpty) process the document.private voidprocessJNI(int isTCas, String sofaName, int[] resultSpecTypes, int[] resultSpecFeatures) private voidprivate voidresetJNI()private voidserializeCASJNI(boolean bSerializeData) private static voidserializeResultSpecification(ResultSpecification rs, CASImpl cas, IntVector resultSpecTypes, IntVector resultSpecFeatures) private voidserializeSegmentJNI(boolean bSerializeData) (package private) static void(package private) voidtypeSystemInit(CASMgrSerializer casMgrSerializer) reinit Taf engine type systemprivate voidtypeSystemInitJNI(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
-