Return-Path: Delivered-To: apmail-uima-user-archive@www.apache.org Received: (qmail 85036 invoked from network); 3 May 2010 15:36:47 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 3 May 2010 15:36:47 -0000 Received: (qmail 86478 invoked by uid 500); 3 May 2010 15:36:47 -0000 Delivered-To: apmail-uima-user-archive@uima.apache.org Received: (qmail 86451 invoked by uid 500); 3 May 2010 15:36:47 -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 86443 invoked by uid 99); 3 May 2010 15:36:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 May 2010 15:36:47 +0000 X-ASF-Spam-Status: No, hits=-0.6 required=10.0 tests=AWL,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of msa@schor.com designates 69.41.245.8 as permitted sender) Received: from [69.41.245.8] (HELO gateway14.websitewelcome.com) (69.41.245.8) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 03 May 2010 15:36:38 +0000 Received: (qmail 9825 invoked from network); 3 May 2010 15:41:05 -0000 Received: from gator74.hostgator.com (67.18.27.130) by gateway14.websitewelcome.com with SMTP; 3 May 2010 15:41:05 -0000 Received: from yktgi01e0-s5.watson.ibm.com ([129.34.20.19]:62733 helo=[9.2.35.72]) by gator74.hostgator.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1O8xgs-0006bb-Vm for user@uima.apache.org; Mon, 03 May 2010 10:36:15 -0500 Message-ID: <4BDEED76.70107@schor.com> Date: Mon, 03 May 2010 11:36:22 -0400 From: Marshall Schor User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: user@uima.apache.org Subject: Re: determining whether a feature has been set References: <4BDED77E.4060405@gmx.de> In-Reply-To: <4BDED77E.4060405@gmx.de> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator74.hostgator.com X-AntiAbuse: Original Domain - uima.apache.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - schor.com You could pick a value which won't occur otherwise. For instance, Float has a special value Float.NaN, which is not a number. (If you use this, remember that the equals test doesn't work on this.) Integers don't have any such value, but some codes use Integer.MIN_VALUE, if it won't occur otherwise. Finally, you could define another feature in your FeatureStructure, of type boolean, and set that to false initially, and true when you set the feature of interest. -Marshall On 5/3/2010 10:02 AM, Thilo Goetz wrote: > On 5/3/2010 15:15, Klaus Rothenhäusler wrote: > >> Hi, >> is there any way to determine whether a feature of a primitive >> numerical type has been set in a particular feature structure? The >> methods like getIntValue(feat), getFloatValue(feat), etc. all return a >> zero value if the feature hasn't been set. But zero is of course a >> perfectly plausible value in many domains. >> >> Thanks >> --Klaus Rothenhäusler >> > There is no way to check this. We do not wrap primitive > values internally, and so do not attach any metadata like, > has it been set or not. It's like a Java primitive variable > in that sense. > > --Thilo > > >