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?
Jörn Kottmann wrote:
Kai Schlamp wrote:
So the only possible solution seems to be to associate the MyDocument
object with the CAS like (aCas.setSource(myDocument). But I am not
sure if there is some way to do this.
Any suggestions?
You can define a Feature Structure type which has an id feature, with an
id you can easily map a CAS object
to on of your document objects using a map.
Here are the necessary steps:
- Put text and id Feature Structure into a CAS from your document object
- Register id and your document object in an intermediate map
- When CAS was processed lookup your document object based on the id
from the CAS
- Copy processing results into your document object
Hope that helps,
Jörn