Return-Path: Delivered-To: apmail-uima-user-archive@www.apache.org Received: (qmail 90099 invoked from network); 11 Nov 2010 07:37:05 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 11 Nov 2010 07:37:05 -0000 Received: (qmail 68677 invoked by uid 500); 11 Nov 2010 07:37:37 -0000 Delivered-To: apmail-uima-user-archive@uima.apache.org Received: (qmail 68503 invoked by uid 500); 11 Nov 2010 07:37:36 -0000 Mailing-List: contact user-help@uima.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@uima.apache.org Delivered-To: mailing list user@uima.apache.org Received: (qmail 68495 invoked by uid 99); 11 Nov 2010 07:37:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Nov 2010 07:37:36 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [77.87.228.73] (HELO m1.mfw.bn.ivbb.bund.de) (77.87.228.73) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Nov 2010 07:37:31 +0000 Received: from m1.mfw.bn.ivbb.bund.de (localhost [127.0.0.1]) by m1.mfw.bn.ivbb.bund.de (8.14.3/8.14.3) with ESMTP id oAB7b92m013421 for ; Thu, 11 Nov 2010 08:37:09 +0100 (CET) Received: (from localhost) by m1.mfw.bn.ivbb.bund.de (MSCAN) id 7/m1.mfw.bn.ivbb.bund.de/smtp-gw/mscan; Thu Nov 11 08:37:09 2010 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: AW: View vs. JCas as process() argument Date: Thu, 11 Nov 2010 08:37:04 +0100 Message-ID: In-Reply-To: <4CD95EF8.3030507@ogren.info> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: View vs. JCas as process() argument Thread-Index: AcuAHR/pfN5s+fxwRDqzqnpeKWoqPABVYJOw References: <4CD95EF8.3030507@ogren.info> From: To: X-OriginalArrivalTime: 11 Nov 2010 07:37:04.0769 (UTC) FILETIME=[3C932710:01CB8173] Philip, thank you. That's really easy and the annotator is more generell = and even shorter in code, now. -----Urspr=FCngliche Nachricht----- Von: user-return-3250-Armin.Wegner=3Dbka.bund.de@uima.apache.org = [mailto:user-return-3250-Armin.Wegner=3Dbka.bund.de@uima.apache.org] Im = Auftrag von Philip Ogren Gesendet: Dienstag, 9. November 2010 15:47 An: user@uima.apache.org Betreff: Re: View vs. JCas as process() argument 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, Armin.Wegner@bka.bund.de wrote: > Hi, > > I would like to add some annotations of type TestTypeA to view ViewA=20 > using analysis engine analysisEngine. The first version given below=20 > works just fine. The new annotations are added to ViewA. The scond=20 > version does not work. The annotations are added to _InitialView. Why? > Logically there is no difference. I would prefere the second version=20 > 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 =3D analysisEngine.newJCas(); > jCas.createView("ViewA"); > analysisEngine.process(jCas); > > 1.2 Annotator > > public void process(JCas jCas) throws AnalysisEngineProcessException { > JCas view =3D jCas.getView("ViewA"); > ... > view.addFsToIndexes(new TestTypeA(view, begin, end)); > ... > } > > > 2. Second Version: Argument is a view, only > > 2.1 Pipeline > > JCas jCas =3D analysisEngine.newJCas(); > jCas.createView("ViewA"); > JCas view =3D 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 > > >