Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A68B8200D2B for ; Thu, 2 Nov 2017 16:24:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id A5419160BDE; Thu, 2 Nov 2017 15:24:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1DC0A1609EE for ; Thu, 2 Nov 2017 16:24:04 +0100 (CET) Received: (qmail 8729 invoked by uid 500); 2 Nov 2017 15:24:04 -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 8713 invoked by uid 99); 2 Nov 2017 15:24:04 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Nov 2017 15:24:04 +0000 Received: from [88.197.39.169] (unknown [88.197.39.169]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 06EA81A0217; Thu, 2 Nov 2017 15:24:02 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: uimaFit JCasUtil.selectAt meaning From: Richard Eckart de Castilho In-Reply-To: Date: Thu, 2 Nov 2017 17:24:00 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <912B268A-C50A-4473-A135-8A49023D1988@apache.org> References: To: user@uima.apache.org X-Mailer: Apple Mail (2.3124) archived-at: Thu, 02 Nov 2017 15:24:05 -0000 Dear Mario, you are right - that appears to be a bug. Could you just copy/paste your = analysis into a Jira issue please? https://issues.apache.org/jira/ Best, -- Richard > On 01.11.2017, at 18:02, Mario Juric wrote: >=20 > Hi, >=20 > I was wondering what exactly the semantics of JCasUtil.selectAt is = supposed to be after looking into the implementation, since the JavaDoc = isn=E2=80=99t very precise. I initially thought that it would select = annotations of the given type with the exact begin and end, but this is = not the case when inspecting the implementation. The problem is in = CasUtil.selectAt with the following while loop: >=20 > while (it.isValid()) { > AnnotationFS a =3D it.get(); > // If the offsets do not match the specified offets, we're done > if (a.getBegin() !=3D aBegin && a.getEnd() !=3D aEnd) { > break; > } > it.moveToNext(); > list.add(a); > } >=20 > I would have expected that either begin or end must be different to = drop the item, i.e. "if (a.getBegin() !=3D aBegin || a.getEnd() !=3D = aEnd)" instead. This is obviously not the case, and it does not have the = same behaviour like selectCovered either, so what is the intend if = it=E2=80=99s not a bug? >=20 > Best, > Mario