Return-Path: Delivered-To: apmail-uima-user-archive@www.apache.org Received: (qmail 99551 invoked from network); 16 Jun 2010 14:34:07 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 16 Jun 2010 14:34:07 -0000 Received: (qmail 20790 invoked by uid 500); 16 Jun 2010 14:34:07 -0000 Delivered-To: apmail-uima-user-archive@uima.apache.org Received: (qmail 20733 invoked by uid 500); 16 Jun 2010 14:34:06 -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 Delivered-To: moderator for user@uima.apache.org Received: (qmail 20252 invoked by uid 99); 16 Jun 2010 14:32:37 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,MSGID_FROM_MTA_HEADER,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of aturbati@hotmail.com designates 65.55.116.92 as permitted sender) X-Originating-IP: [93.40.130.247] X-Originating-Email: [aturbati@hotmail.com] Message-ID: Date: Wed, 16 Jun 2010 16:32:08 +0200 From: Andrea Turbati User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; it; rv:1.9.1.9) Gecko/20100317 Lightning/1.0b1 Thunderbird/3.0.4 MIME-Version: 1.0 To: user@uima.apache.org Subject: Re: newbie aggregate AE References: <4C18C220.6090509@schor.com> In-Reply-To: <4C18C220.6090509@schor.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 16 Jun 2010 14:32:08.0864 (UTC) FILETIME=[B36F7A00:01CB0D60] Thanks for the anwer. At the moment I've unzipped the pear so, and the AAE descriptor points to the two directory. Maybe I've written a bad java code, but it's copied from another project where I used one of the two unzipped simple AE and it works fine. What is the right way to call an AAE from a java sofware? Thanks Andrea Il 16/06/2010 14:22, Marshall Schor ha scritto: > Does it work if you don't use PEARs? > > -Marshall > > On 6/15/2010 4:25 AM, Andrea Turbati wrote: > >> Hi all, >> I'm a newbie and I'm trying to build an aggregate AE from two (very >> simple) AE. >> On this guide >> http://uima.apache.org/downloads/releaseDocs/2.3.0-incubating/docs/pdf/tutorials_and_users_guides.pdf >> on page 49 (55) there is an example of an aggregate AE Descriptor, so >> I've copied and this is my AAE descriptor: >> >> >> > xmlns="http://uima.apache.org/resourceSpecifier"> >> org.apache.uima.java >> false >> >> >> >> >> >> >> >> >> >> Aggregate AE - Room Number and DateTime Annotators >> Detects Room Numbers, Dates, and Times >> >> >> SimpleName >> EmailRecognizer >> >> >> >> >> >> And this is the java code I'm using: >> >> ... >> pearDir = new File(aggregateAEPath).toURI(); >> browser = new PackageBrowser(new File(pearDir.getPath())); >> in = new XMLInputSource(aggregateAEFilePath); >> specifier = >> UIMAFramework.getXMLParser().parseResourceSpecifier(in); >> resManager = UIMAFramework.newDefaultResourceManager(); >> >> resManager.setExtensionClassPath(aeSimpleNamePath+"/bin",true); // >> TODO check if this is necessary >> resManager.setExtensionClassPath(aeEmailPath+"/bin",true); >> // TODO check if this is necessary >> ae = UIMAFramework.produceAnalysisEngine(specifier, >> resManager, null); >> ae.setConfigParameterValue("Encoding", "UTF-8"); >> annotCas = ae.newJCas(); >> annotCas.setDocumentText(textToBeAnnotatate); >> annotCas.setDocumentLanguage("it"); >> ae.process(annotCas); >> FSIndex indexAnnotations = annotCas.getAnnotationIndex(); >> Iterator annoIt = indexAnnotations.iterator(); >> while(annoIt.hasNext()){ >> Annotation annotation = annoIt.next(); >> String text = annotation.getCoveredText(); >> int begin = annotation.getBegin(); >> int end = annotation.getEnd(); >> String type = annotation.getType().getName(); >> System.out.println("text: "+text+"\tbegin: >> "+begin+"\tend:"+end+"\ttype:"+type); >> } >> ... >> >> The problem is that the last System.out.println prints just all the >> input text and no annoation, while if I use a very similar code with >> the two simple AE I get all the annotation. >> >> What am I doing wrong? >> >> Thanks, >> >> Andrea >> >> > -- ------------------------------------------------- Dott. Andrea Turbati AI Research Group PhD student, Dept. of Computer Science, Systems and Production University of Roma, Tor Vergata Via del Politecnico 1 00133 ROMA (ITALY) tel: +39 06 7259 7332 (lab) e_mail: turbati@info.uniroma2.it home page: http://art.uniroma2.it/turbati/ --------------------------------------------------