Kai Schlamp wrote:
Jörn, thanks for your help.
I trying now to add a new feature structure to my CAS. In the CAS
Reference guide it says
that a "specification of types and features at run time" is possible.
But I can't figure out how to do it.
It seems cas.createFS(type) is the way to go, but I can't find any
example code.
Espcially how to create that type that is needed (how do I instantiate
a TOP_TYPE?).
Do you have a short example for me somewhere around?
You should have a look at the CAS refeence documentation:
http://incubator.apache.org/uima/downloads/releaseDocs/2.2.2-incubating/docs/html/references/references.html#ugr.ref.cas
To your question, first you have to obtain the Type object describing
your Feature Structure.
I assume that you already have a reference to a CAS object, then you can
call cas.getTypeSystem().getType("com.xxx.FeatureStructureName") to get it.
The type object you pass into CAS.createFS and then you have to add the
FS to the index with CAS.addFsToIndexes
Jörn