Return-Path: Delivered-To: apmail-incubator-uima-user-archive@minotaur.apache.org Received: (qmail 69304 invoked from network); 8 Dec 2009 15:55:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Dec 2009 15:55:34 -0000 Received: (qmail 82118 invoked by uid 500); 8 Dec 2009 15:55:34 -0000 Delivered-To: apmail-incubator-uima-user-archive@incubator.apache.org Received: (qmail 82063 invoked by uid 500); 8 Dec 2009 15:55:33 -0000 Mailing-List: contact uima-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: uima-user@incubator.apache.org Delivered-To: mailing list uima-user@incubator.apache.org Received: (qmail 82053 invoked by uid 99); 8 Dec 2009 15:55:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2009 15:55:33 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gcaug-uima-user@m.gmane.org designates 80.91.229.12 as permitted sender) Received: from [80.91.229.12] (HELO lo.gmane.org) (80.91.229.12) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2009 15:55:30 +0000 Received: from list by lo.gmane.org with local (Exim 4.50) id 1NI2P3-0005tn-JU for uima-user@incubator.apache.org; Tue, 08 Dec 2009 16:55:05 +0100 Received: from STAINES.LTI.CS.CMU.EDU ([128.2.212.103]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 08 Dec 2009 16:55:05 +0100 Received: from er1k by STAINES.LTI.CS.CMU.EDU with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 08 Dec 2009 16:55:05 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: uima-user@incubator.apache.org From: Eric Riebling Subject: Annotation vs. FeatureStructure: CAS Consumer in Aggregate AE Date: Tue, 8 Dec 2009 15:11:06 +0000 (UTC) Lines: 30 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 128.2.212.103 (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.13) Gecko/2009073022 Firefox/3.0.13 (.NET CLR 3.5.30729)) Sender: news I'm running a UIMA-AS aggregate that consists of a single annotator, and a Base UIMA Collection Reader and CAS Consumer. I configure the annotator and CAS Consumer as an Aggregate AE, and send it CASes using runRemoteAsyncAE, specifying the Collection Reader. The CAS Consumer works fine with base UIMA, but when running it this way as "pure UIMA-AS" it has trouble in the code which reads annotations out of the CAS's AnnotationIndex. Specifically, it gets a ClassCastException: Caused by: java.lang.ClassCastException: org.apache.uima.cas.impl.AnnotationImpl in the code that iterates through the AnnotationIndex: AnnotationIndex idx = (AnnotationIndex) aCAS.getAnnotationIndex( wordType ); Iterator it = idx.iterator(); // for each word while ( it.hasNext() ) { Annotation a = (Annotation) it.next(); I'm confused by a couple of points: 1. How come the code works fine with base UIMA if there's a type casting issue 2. Since the default type returned by the next() method of an annotation iterator is normally a FeatureStructure, it seems that I should use FeatureStructures, not Annotations. How do I go about obtaining the same information I would have gotten from Annotations, such as from Annotation.getBegin(), Annotation.getCoveredText(), etc.? Those methods are not present on FeatureStructure, as far as I can tell.