The view passed to an annotator process method is controlled by the annotator being sofa aware and by sofa mapping.
See http://uima.apache.org/downloads/releaseDocs/2.3.0-incubating/docs/html/tutorials_and_users_guides/tutorials_and_users_guides.html#ugr.tug.mvs.deciding_multi_view and the subsequent section on sofa mapping. Eddie On Tue, Nov 9, 2010 at 2:13 AM, <[email protected]> wrote: > Hi, > > I would like to add some annotations of type TestTypeA to view ViewA > using analysis engine analysisEngine. The first version given below > works just fine. The new annotations are added to ViewA. The scond > version does not work. The annotations are added to _InitialView. Why? > Logically there is no difference. I would prefere the second version as > it is more generell. The analysis engine does not need to know the view. > > Any ideas? > > Armin > > > > 1 First Version: Argument is a whole JCas > > 1.1 Pipeline > > JCas jCas = analysisEngine.newJCas(); > jCas.createView("ViewA"); > analysisEngine.process(jCas); > > 1.2 Annotator > > public void process(JCas jCas) throws AnalysisEngineProcessException { > JCas view = jCas.getView("ViewA"); > ... > view.addFsToIndexes(new TestTypeA(view, begin, end)); > ... > } > > > 2. Second Version: Argument is a view, only > > 2.1 Pipeline > > JCas jCas = analysisEngine.newJCas(); > jCas.createView("ViewA"); > JCas view = jCas.getView("ViewA"); > analysisEngine.process(view); > > 2.2 Annotator > > public void process(JCas view) throws AnalysisEngineProcessException { > ... > view.addFsToIndexes(new TestTypeA(view, begin, end)); > ... > } >
