From user-return-6779-apmail-uima-user-archive=uima.apache.org@uima.apache.org Sun Oct 11 14:55:06 2015 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 0AA6118BDF for ; Sun, 11 Oct 2015 14:55:06 +0000 (UTC) Received: (qmail 26646 invoked by uid 500); 11 Oct 2015 14:55:05 -0000 Delivered-To: apmail-uima-user-archive@uima.apache.org Received: (qmail 26598 invoked by uid 500); 11 Oct 2015 14:55:05 -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 26585 invoked by uid 99); 11 Oct 2015 14:55:05 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 Oct 2015 14:55:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id BF9371A092F for ; Sun, 11 Oct 2015 14:55:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.12 X-Spam-Level: X-Spam-Status: No, score=-0.12 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, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Z9jvx7k3DqO5 for ; Sun, 11 Oct 2015 14:54:56 +0000 (UTC) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com [209.85.217.174]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 7CE6B2031C for ; Sun, 11 Oct 2015 14:54:55 +0000 (UTC) Received: by lbwr8 with SMTP id r8so120245908lbw.2 for ; Sun, 11 Oct 2015 07:54:54 -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; bh=c48qAEIKmdrCLPIsmmdB4dgr1kfD+mWHIMfehc4aeow=; b=UoXr0CN1xj9h4XdcggGKc8wzzdiapcxxHnNIA1shY0gS+Hzqk/QAw95RNtHkeFJIUI 5ybI1d/IEw3NaanS5gGcemOe5Xsyy9vSQRm3Xmlj+dBxoMyCGNDNHqEcbIEImZyeQ4Ar EPuW423ktgNjJWO9E8e3aOm2D9JbgeSr3532eed0WeJolh6L4FowQlZF3rTwf01aDO6d 63yRcWmkKCJbrnnmDlCf0qo33C/I2kx+c7f2m0364SDJN+dyqP5UNQCR4rD2rFUFqQhi AoY5lS0Ak4ZLlJrudyoyVRr2dH4nCNAofMFStPT82YiOpAvGv212g3k0nsDoPMYayYFb /NMg== X-Received: by 10.25.40.65 with SMTP id o62mr6907164lfo.115.1444575293939; Sun, 11 Oct 2015 07:54:53 -0700 (PDT) Received: from [192.168.22.20] ([87.104.197.212]) by smtp.gmail.com with ESMTPSA id oi5sm1214668lbb.13.2015.10.11.07.54.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 11 Oct 2015 07:54:45 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: Support for UIMA arrays in Ruta From: Mario Gazzo In-Reply-To: <561A728D.70802@averbis.com> Date: Sun, 11 Oct 2015 16:54:41 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <743D09DE-8BD9-4F03-AB2A-4CE2C220E069@gmail.com> References: <3959E561-1BAD-4973-A695-EFB298CF905E@gmail.com> <56140068.8070007@averbis.com> <561412C3.4000808@averbis.com> <8BC97EFD-5FE1-4B40-8AF0-7239581A8DB5@gmail.com> <561A2717.2060002@averbis.com> <6F83ECE9-0C5D-4E8A-B2D0-F11A9C5CAD57@gmail.com> <561A728D.70802@averbis.com> To: user@uima.apache.org X-Mailer: Apple Mail (2.2104) I just mean a separated match context. I am not sure GATHER fits what I = am trying to achieve but I can see what you mean. I am not sure how I = would go about doing the match in my case but I am still learning how to = get the most out of the existing RUTA features so I would have to think = a little bit more about it. We can of course share any custom actions or similar components if they = make sense for others to use as well. Much of what we implement is to = some degree coupled to how we choose to do things but I can send you any = custom actions if we create them. Cheers Mario > On 11 Oct 2015, at 16:30 , Peter Kl=C3=BCgl = wrote: >=20 > Hi, >=20 > what do you mean by document scope? A different sofa/CAS or just a = separated match context? >=20 > An additional action is always an option. In the second case, the = GATHER action could maybe help. It was added to assign only specific = annotations to the features. However, you would still need to match on = them. >=20 > btw, contributions of new actions/conditions and functions are always = wlecome :-) >=20 > Best, >=20 > Peter >=20 > Am 11.10.2015 um 16:13 schrieb Mario Gazzo: >> Thanks Peter, >>=20 >> It works when I assign the FSArray the way you describe. However, I = sometimes want to reference annotations across different document = scopes. Therefore I try to capture some annotations in dedicated list = variables so that I can reference them later in a CREATE action within = some other document scope, but this is currently not possible as you = state. I guess I would then have to implement my own action to do this. >>=20 >> Cheers >> Mario >>=20 >>> On 11 Oct 2015, at 11:08 , Peter Kl=C3=BCgl = wrote: >>>=20 >>> Hi, >>>=20 >>> no, that's not possible. The CREATE accepts only type expressions, = the GATHER integers and additionally integer lists (but these are = referring to rule elements). A type list can only store type = (expressions) and not the annotations themselves. >>>=20 >>> You must know that these actions were added due to some requirements = in specific use cases/projects. Then, we tried to make them more generic = and useful in also other use cases. There are plans to replace the = extensive usage of type expression with a new construct referring = annotations more generally... >>>=20 >>> Now to your problem :-) >>>=20 >>> The CREATE action (and similar actions) checks the type of the = feature and collects all annotations of the type specified by the type = expression. In case of the CREATE action: if the feature expects a = single annotation, then the first annotation within the matched context = is assigned. If the feature allows multple annotations (FSArray), then = all annotations of the specified type within the matched context are = assigned. >>>=20 >>> This means you need only to use the type of the FSArray in the = CREATE action. The actual selection of the annotations is controlled of = their types, e.g., you maybe need to create new annotations of derived = types. >>>=20 >>> Here a simple example (not tested): >>> DECLARE Container (FSArray tokens); >>> Sentence{-> CREATE(Container, "tokens" =3D Token)}; >>>=20 >>> Here, an annotation of type Container is created for each Sentence = and all Token annotations within this sentence are assigned to the = feature "tokens", which is an FSArray. >>>=20 >>> I hope that helps :-) >>>=20 >>> Best, >>>=20 >>> Peter >>>=20 >>> Am 10.10.2015 um 23:00 schrieb Mario Gazzo: >>>> Can I assign a typelist to a FSArray feature in a CREATE action? >>>>=20 >>>> I tried to read some annotations into a typelist variable using = GETLIST and then assign it to a FSArray feature in a CREATE statement = but it doesn=E2=80=99t seem to work. How does one do this otherwise? >>>>=20 >>>> Cheers, >>>> Mario >>>>=20 >>>>> On 06 Oct 2015, at 20:28 , Peter Kl=C3=BCgl = wrote: >>>>>=20 >>>>> The most important actions are CREATE and GATHER. There are also = some others like FILL or SETFEATURE. >>>>>=20 >>>>> The ASSIGN action works only for variables. >>>>>=20 >>>>> Best, >>>>>=20 >>>>> Peter >>>>>=20 >>>>>=20 >>>>> Am 06.10.2015 um 19:47 schrieb Mario Gazzo: >>>>>> That=E2=80=99s completely understandable, Peter. >>>>>>=20 >>>>>> FSArray assignment might just do it for me at the moment. Could = you point me to the special actions you are mentioning? Is it the Assign = action? >>>>>>=20 >>>>>> Cheers >>>>>> Mario >>>>>>=20 >>>>>>> On 06 Oct 2015, at 19:10 , Peter Kl=C3=BCgl = wrote: >>>>>>>=20 >>>>>>> Hi Mario, >>>>>>>=20 >>>>>>> yes, sadly, it's true. Only the assignments to FSArrays using = special actions is supported right now. >>>>>>>=20 >>>>>>> I did not find the time to implement it for 2.3.0 or 2.3.1, but = I really hope I can do it for 2.4.0. >>>>>>>=20 >>>>>>> Any help is welcome :-) >>>>>>>=20 >>>>>>> (however, I must admit that this is trickier and more work than = it looks like) >>>>>>>=20 >>>>>>> Best, >>>>>>>=20 >>>>>>> Peter >>>>>>>=20 >>>>>>> Am 06.10.2015 um 19:02 schrieb Mario Gazzo: >>>>>>>> Hej Peter, >>>>>>>>=20 >>>>>>>> Does Ruta still not support UIMA arrays in version 2.3? >>>>>>>>=20 >>>>>>>> Found this post from May this year that says it isn=E2=80=99t = supported in version 2.2.1: >>>>>>>>=20 >>>>>>>> = https://mail-archives.apache.org/mod_mbox/uima-user/201505.mbox/%3C5558A07= 4.9090405@averbis.com%3E = >>>>>>>>=20 >>>>>>>> Couldn=E2=80=99t find anything about it in the latest Ruta docs = either. >>>>>>>>=20 >>>>>>>> Cheers >>>>>>>> Mario >=20