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 8E60018A47 for ; Mon, 12 Oct 2015 18:38:17 +0000 (UTC) Received: (qmail 467 invoked by uid 500); 12 Oct 2015 18:38:04 -0000 Delivered-To: apmail-uima-user-archive@uima.apache.org Received: (qmail 360 invoked by uid 500); 12 Oct 2015 18:38: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 Delivered-To: moderator for user@uima.apache.org Received: (qmail 723 invoked by uid 99); 11 Oct 2015 14:21:13 -0000 X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.121 X-Spam-Level: X-Spam-Status: No, score=-0.121 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com 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; bh=BNz+jbWk5GCF8bDDdvKhLV3q6ZWtAq4xcGqxU6AjT4Q=; b=RX1Yo9Yqau6qgD+Uea6o0yoc9qVCBU82hdMqXxIxHn8aMFX6lw+by/SdX/8G65Yy4O yj1+a8XaDU/SdBYOv28GyACEr6zqojWyaDLfKPD0RSJzetFvp/P9W4HoCULiEeTTF92e /rtknnK/rrrQz/884rUp6CmQ5yJl/ywRUs9rOWObB8uSyWuHCJSdZhKTPzGKSfLZCqFa TuOrOZs3U8nuQrtPzZrZEhPqnzLXRDNIhw0d5utlgPL0wFBQXXJeRhA3KzzHNWVTvpY/ /Zhy4tDk1fNzVeLhq99/byoDWDcASVNYpy1gWIqXIGfYRQMbaoSbnApZ+G5casqwz6TP NcBw== X-Received: by 10.25.40.65 with SMTP id o62mr6881505lfo.115.1444573269973; Sun, 11 Oct 2015 07:21:09 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: RUTA variable assignment problem From: Mario Juric In-Reply-To: <1C21AED0-4FE9-45C5-8303-DE602C6CABB4@gmail.com> Date: Sun, 11 Oct 2015 16:21:06 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <1C21AED0-4FE9-45C5-8303-DE602C6CABB4@gmail.com> To: user@uima.apache.org X-Mailer: Apple Mail (2.2104) I am still struggling with the use of variables in some CREATE = statements. The features do not always have the expected values after = CREATE. Let me give another more concrete example: TYPE pmcIdentifier; BLOCK(ForEach) IdentifierAnnotation.propertyName=3D=3D"PMC"{} { // Just = capturing scope IdentifierAnnotation.propertyName=3D=3D"PMC" { -> = ASSIGN(pmcIdentifier, IdentifierAnnotation), LOG(pmcIdentifier.ct)}; } TYPE doiIdentifier; BLOCK(ForEach) IdentifierAnnotation.propertyName=3D=3D"DOI"{} { // Just = capturing scope IdentifierAnnotation.propertyName=3D=3D"DOI" { -> = ASSIGN(doiIdentifier, IdentifierAnnotation), LOG(doiIdentifier.ct)}; } BLOCK(ForEach) XMLTagAnnotation.path=3D=3D"article/front/article-meta"{} = { XMLTagAnnotation.name=3D=3D"article-meta" { -> CREATE( DocumentInfoAnnotation, =E2=80=9Cid" =3D pmcIdentifier, "doi" =3D doiIdentifier ) }; } The IdentifierAnnotation annotations have successfully been created in = statements not shown here, which is also evident from a CAS inspection, = and the LOG actions output the expected strings, but when I reference = the variables in the CREATE action then the id and doi features of the = DocumentInfoAnnotation end up pointing to the same identifier (pmc in = the above example). Its puzzling me how this can happen. > On 09 Oct 2015, at 15:41 , Mario Juric = wrote: >=20 > Hi, >=20 > I have a annotation type variable that I am assigning a value in a = statement block and then use that value in match rule to set the = attribute in a new annotation like this: >=20 > Type myvar; >=20 > BLOCK(ForEach) UniqueMatch{} { // Capturing unique scope with this > =E2=80=9CSome (\\w+) Regex" -> 1 =3D MatchedRegexAnnotation; > MatchedRegexAnnotation { -> ASSIGN(myvar, MatchedRegexAnnotation)}; > } >=20 > SomeOtherMatch{} { > -> CREATE(Markup, =E2=80=9Cmyprop=E2=80=9D =3D myvar) > }; >=20 > The =E2=80=9Cmyprop=E2=80=9D attribute never gets a value even though = the MatchedRegexAnnotation is created. A completely analog = implementation appears to work flawlessly in another context but not in = the current. >=20 > I am in the dark about this and my Ruta skills are sill infant so any = idea to what could be the problem is much appreciated. >=20 > Cheers > Mario