Hi Torsten,

I got the idea. The easiest way would be to use 
org.uimafit.component.xwriter.XWriter as a kind of visualizer. But that does 
not work. XWriter does always write the whole CAS instead of the mapped view. I 
tried

CollectionReaderDescription reader = CollectionReaderFactory...
AggregateBuilder builder = new AggregateBuilder();
AnalysisEngineDescription writer = 
AnalysisEngineFactory.createPrimitiveDescription(XWriter.class, 
XWriter.PARAM_OUTPUT_DIRECTORY_NAME, outputDirectoryName);
builder.add(writer, CAS.NAME_DEFAULT_SOFA, "viewName");  // viewName is the 
name of the view that should be serialized
SimplePipeline.runPipeline(reader, builder.createAggregateDescription());

Regards,

Armin


-----Ursprüngliche Nachricht-----
Von: Torsten Zesch [mailto:[email protected]] 
Gesendet: Donnerstag, 22. Dezember 2011 09:10
An: [email protected]
Betreff: RE: Extracting a single view from a CAS

Hi Armin,

it seems you are asking for two things:
1) How to visualize a CAS?
2) How to handle multiple views?

1) It strongly depends on what you want to visualize. If you just want to look 
at the annotations you might use the CAS Visualizer or CAS Editor. Or you can 
always write your own annotator that outputs the desired visualization.

2) As a view is just a "CAS in disguise" you may simply write a view-unaware 
annotator doing all the visualization on a single CAS and then use SofA mapping 
when assembling the pipeline.
An example using uimaFIT:

AnalysisEngineDescription visualizer = createPrimitiveDescription(
    Visualizer.class
);

AggregateBuilder builder = new AggregateBuilder(); builder.add(visualizer, 
"_InitialView", VIEW_1); builder.add(visualizer, "_InitialView", VIEW_2); ...
builder.add(visualizer, "_InitialView", VIEW_N); AnalysisEngineDescription aggr 
= builder.createAggregateDescription();

where VIEW_1 ... VIEW_N are the names of your views.

-Torsten

> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> Sent: Thursday, December 22, 2011 8:30 AM
> To: [email protected]
> Subject: Extracting a single view from a CAS
> 
> Hi,
> 
> how to extract a single view from a CAS with text sofas? It's nice to 
> have a CAS with multiple views. But how to visualize all the views? I 
> like to see them, to check if they are ok. Is there any analysis 
> engine for doing that?
> 
> I'm thinking of writing a CAS multiplier that puts each view in its 
> own CAS as _InitialView. What do you think about that?
> 
> Sincerely,
> 
> Armin

Reply via email to