view = cas.get_view("TargetView")
for sentence in view.select('de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Sentence'):
for token in view.select_covered('de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token', sentence):
print(token.get_covered_text(), token.pos.PosValue)
You can see the views in the XMI here:
<cas:Sofa xmi:id="12" sofaNum="1" sofaID="_InitialView" mimeType="text"
sofaString="This is a simple test sentence. Here comes another one. I went to the park yesterday, it was beautiful. "/>
<cas:Sofa xmi:id="300" sofaNum="2" sofaID="TargetView" mimeType="text"
sofaString="This is a simple test sentence. Here comes another one. I went to the park yesterday, it was beautiful. "/>
It looks like the tokens and sentences are duplicated in both.
Thanks for using cassis!
Best,
Jan