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));
...
}
|