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 9FC1018BA3 for ; Sun, 11 Oct 2015 14:31:04 +0000 (UTC) Received: (qmail 9638 invoked by uid 500); 11 Oct 2015 14:31:04 -0000 Delivered-To: apmail-uima-user-archive@uima.apache.org Received: (qmail 9594 invoked by uid 500); 11 Oct 2015 14:31: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 9583 invoked by uid 99); 11 Oct 2015 14:31:03 -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:31:03 +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 801211A092C for ; Sun, 11 Oct 2015 14:31:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1 X-Spam-Level: * X-Spam-Status: No, score=1 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H2=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled 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 vl-w9iXSvga8 for ; Sun, 11 Oct 2015 14:30:54 +0000 (UTC) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.131]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 6D1812031C for ; Sun, 11 Oct 2015 14:30:54 +0000 (UTC) Received: from [192.168.0.5] ([46.223.1.40]) by mrelayeu.kundenserver.de (mreue003) with ESMTPSA (Nemesis) id 0Ltj6n-1amIIl3BFl-011967 for ; Sun, 11 Oct 2015 16:30:46 +0200 Subject: Re: Support for UIMA arrays in Ruta To: user@uima.apache.org 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> From: =?UTF-8?Q?Peter_Kl=c3=bcgl?= Message-ID: <561A728D.70802@averbis.com> Date: Sun, 11 Oct 2015 16:30:37 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <6F83ECE9-0C5D-4E8A-B2D0-F11A9C5CAD57@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:O36vvH7pynrM+F5Y2CXRCvYT0FvcLWHOJQ1Q+RVmydO+zsWmVse QAPKmROEZ0/i0nHcTJfwMnDLw/Kzw9qZWpmqT5lcYwM6Fps0NCrplyRsqDsBExGJ9JB69jf jnqxZxjB3khPqv3Lqc/p/W9f9Y2OMUdxQOTCMYUkVY4agP34eq6CKFPRNisuXdDo8Yx5oGY 61w29wDr5VbICgkz20uOg== X-UI-Out-Filterresults: notjunk:1;V01:K0:S5TK7Rzmbco=:Fu377wUkJbPH+Z3iRLJO0e KSFLlqHrwhzsilCwfZTRsOeiyrNJqpMVBZCd4baiHkdt5Vhkx2MWb8jA1L3v4nO7u/DsVdwvl hrCrnHXj6AtIoGm28Uer8Co/mNwn3F/1UNrVnd5caaTkn9dVOd/pwneaC5Nd/Pc40NNzGsvbG 5CJz25QNseJkLKfc9WgN03S0uQ55+yOMA3cwso2xxTThA6wpo9l5OE/dQezixuaedF4wtYz7Z dJ/8/CNt/38hl8RX+cJN9l8XjDmwYFxMGFZFTOk4mEkNFXn7OrjQI9qAzrZiuBvK2HCN6TjzD KjmwW1Ds4YDf4KRaTFsPi03+Qro/HFWoF7qrGO5TprlJEOsJQ5tofX8a6DH5WxkWygWQ1mCGu irtXzEy9PGk1PqI2Wj3uV5so0BOgqAjmHfBCVXIBp2FeToRK0WdqvdsW4cFwhjgof1R3oiodB yCkGMVOwHdkFgv4Yu551EzkPuu0xGKjP9C0hLSrY99jr5s4xUaKN4pB4hw8EvrJVSoRylmlOw CmRoKGNZkB/F0AXgW5H6u2jBFxvumm7T1VxOeahCNP1XSVJgn73eMlOKh/Jfqj8aqkr0kOWao V0FIGppltJ8yZR2r0cwVM5WuIN8KlB5qiADmkN4J61DcWGGnI5+OzCvicb5qNtkW1Cu+eGQPC dFwneOQ4HuzopT7To+lTzLucyh5eXT5uMbhdL7zt5cFBBFEJS61ycqf2AdnzHxeKtmvPN0bkG L9uVBEG1/TnhDv+mQ/xC5k52aDC27Pa2VTb0EDUJi2n9GGViNBKO2EHi/s8= Hi, what do you mean by document scope? A different sofa/CAS or just a separated match context? 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. btw, contributions of new actions/conditions and functions are always wlecome :-) Best, Peter Am 11.10.2015 um 16:13 schrieb Mario Gazzo: > Thanks Peter, > > 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. > > Cheers > Mario > >> On 11 Oct 2015, at 11:08 , Peter Klügl wrote: >> >> Hi, >> >> 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. >> >> 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... >> >> Now to your problem :-) >> >> 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. >> >> 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. >> >> Here a simple example (not tested): >> DECLARE Container (FSArray tokens); >> Sentence{-> CREATE(Container, "tokens" = Token)}; >> >> 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. >> >> I hope that helps :-) >> >> Best, >> >> Peter >> >> Am 10.10.2015 um 23:00 schrieb Mario Gazzo: >>> Can I assign a typelist to a FSArray feature in a CREATE action? >>> >>> 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’t seem to work. How does one do this otherwise? >>> >>> Cheers, >>> Mario >>> >>>> On 06 Oct 2015, at 20:28 , Peter Klügl wrote: >>>> >>>> The most important actions are CREATE and GATHER. There are also some others like FILL or SETFEATURE. >>>> >>>> The ASSIGN action works only for variables. >>>> >>>> Best, >>>> >>>> Peter >>>> >>>> >>>> Am 06.10.2015 um 19:47 schrieb Mario Gazzo: >>>>> That’s completely understandable, Peter. >>>>> >>>>> 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? >>>>> >>>>> Cheers >>>>> Mario >>>>> >>>>>> On 06 Oct 2015, at 19:10 , Peter Klügl wrote: >>>>>> >>>>>> Hi Mario, >>>>>> >>>>>> yes, sadly, it's true. Only the assignments to FSArrays using special actions is supported right now. >>>>>> >>>>>> 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. >>>>>> >>>>>> Any help is welcome :-) >>>>>> >>>>>> (however, I must admit that this is trickier and more work than it looks like) >>>>>> >>>>>> Best, >>>>>> >>>>>> Peter >>>>>> >>>>>> Am 06.10.2015 um 19:02 schrieb Mario Gazzo: >>>>>>> Hej Peter, >>>>>>> >>>>>>> Does Ruta still not support UIMA arrays in version 2.3? >>>>>>> >>>>>>> Found this post from May this year that says it isn’t supported in version 2.2.1: >>>>>>> >>>>>>> https://mail-archives.apache.org/mod_mbox/uima-user/201505.mbox/%3C5558A074.9090405@averbis.com%3E >>>>>>> >>>>>>> Couldn’t find anything about it in the latest Ruta docs either. >>>>>>> >>>>>>> Cheers >>>>>>> Mario