Hello,
I am using UIMA and UIMAFit, but I am still kind of a beginner.
Is there a way to obtain a specific UIMA-type without having access to a
CAS ? At the moment I create a TypeSystemDescription and a
CollectionReader. With that reader I get my CASes. Only from those CASes
I can get the TypeSystem from which I can get the type I want. The code
always looks like this
void doSomething() {
TypeSystemDescription tsd =
UIMAFramework.getXMLParser().parseTypeSystemDescription(new
XMLInputSource(aTSFile));
CollectionReader cr =
CollectionReaderFactory.createCollectionReader(MyReaderClass, tsd);
JCasIterable iterable = new JCasIterable(reader);
Type myType = null;
for (JCas aJCas : iterable) {
if (myType == null) {
myType = aJCAS.getCas().getType("my.type.atype1");
}
AnnotationIndex<Annotation> index = aJCas .getAnnotIndex(myType);
doSomethingWithTheAnnotations()...
}
}
It looks a bit ugly from the logical structure that the type has to be
obtained insed the for loop. It would think it desireable to have a
method to get this type already outside the loop.
How is this done correctly ?
Greetings
Georg
--
---------------------------------------------------------------------
Dipl.-Inf. Georg Fette Raum: B009
Universität Würzburg Tel.: +49-(0)931-31-85516
Am Hubland Fax.: +49-(0)931-31-86732
97074 Würzburg mail: [email protected]
---------------------------------------------------------------------