Armin,
This looks vaguely like something you might be tempted to try when using
uimaFIT (as you recently mentioned you were using.) I believe that the
"UIMA way" is to leave your analysis engine unaware of what view it
should work on (assuming the analysis engine works on a single view) and
then at run time use a sofa mapping to decide which view it actually
works on. The easiest way to set this up in uimaFIT is to use the
AggregateBuilder class which has an add method that looks something like
this:
builder.add(analysisEngineDescription, CAS.NAME_DEFAULT_SOFA, "ViewA");
Hope this helps.
Philip
On 11/9/2010 12: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));
...
}
-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1153 / Virus Database: 424/3245 - Release Date: 11/08/10