Return-Path: X-Original-To: apmail-uima-user-archive@www.apache.org Delivered-To: apmail-uima-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 00AFE10BF7 for ; Fri, 12 Jul 2013 18:59:20 +0000 (UTC) Received: (qmail 75526 invoked by uid 500); 12 Jul 2013 18:59:19 -0000 Delivered-To: apmail-uima-user-archive@uima.apache.org Received: (qmail 75431 invoked by uid 500); 12 Jul 2013 18:59:19 -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 75412 invoked by uid 99); 12 Jul 2013 18:59:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Jul 2013 18:59:18 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of richard.eckart@gmail.com designates 209.85.215.172 as permitted sender) Received: from [209.85.215.172] (HELO mail-ea0-f172.google.com) (209.85.215.172) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Jul 2013 18:59:06 +0000 Received: by mail-ea0-f172.google.com with SMTP id q10so6535309eaj.17 for ; Fri, 12 Jul 2013 11:58:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=yqwYDSOPQ5B/DR1BGhCugEWmJn+LmmYy1WbHX7AJViY=; b=MFAHwfVCpUriKf3zNKyePEK0xVkw6FlkfBsT2GFaILQT5mlKsUOfcmINLvcrTpSEff gD/5Ohmi6niVxpWk0OiUDBJ24tG7xDeqAQ/L6mzn083c2Fu3GOHTD4OlVVgYvufd2WuO ogYF7HlajPRr8xhnLbBjMkXtm2I1zhKqYFavUTanwE+6ct6DatTGGw/TkegbtpPlZK/5 1g64ECzjgVUfViyQLtmmbm1f+rxbN3+sb1+4onu7PnvCLb/Vg7KFQJvof0nZsk2LF9oS 3n7rFQUJoLti0tQyof4Gf4f/VO8apNGv+GesCWJmEOnCvtgotsj5NisoVxuy8uTBZclw k1dQ== X-Received: by 10.15.110.10 with SMTP id cg10mr49067523eeb.57.1373655525628; Fri, 12 Jul 2013 11:58:45 -0700 (PDT) Received: from [10.0.1.20] (ip-176-199-182-177.unitymediagroup.de. [176.199.182.177]) by mx.google.com with ESMTPSA id m1sm80742190eex.17.2013.07.12.11.58.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Jul 2013 11:58:43 -0700 (PDT) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: Getting all Features for any Annotator From: Richard Eckart de Castilho In-Reply-To: Date: Fri, 12 Jul 2013 20:58:38 +0200 Content-Transfer-Encoding: 7bit Message-Id: <0F926B8D-EEC1-4726-9217-6F13121E8DA9@gmail.com> References: To: user@uima.apache.org X-Mailer: Apple Mail (2.1508) X-Virus-Checked: Checked by ClamAV on apache.org People tend to fall back to using Java Reflections on the JCas wrappers, before using the lower-level UIMA interfaces (CAS and AnnotationFS/ FeatureStructure). Every UIMA annotation implements the interface FeatureStructure. This interface in conjunction with the type system information you can obtain from the CAS, provides all you need to extract all information. There is no need to resort to reflection. You may want to have a look at the source code of the CasCopier class too. -- Richard Am 12.07.2013 um 20:16 schrieb Chuong Ngo : > Is there a way to get all the features for an annotator, no matter which > one it is? > > For example, I want to convert all annotators I get back into a JSON > respresenting that annotator. My annotators have different number and > types of features. For example, a person may have firstName, lastName > while an organization may have type, health, etc... Is there another way > to do that besides casting each one to a predetermined type and then using > the getters to extract the feature values? Thanks in advance. > > Chuong Ngo