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 <[email protected]> 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 <[email protected]> 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 <[email protected]> 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/%[email protected]%3E >>>>>> >>>>>> <https://mail-archives.apache.org/mod_mbox/uima-user/201505.mbox/%[email protected]%3E> >>>>>> >>>>>> Couldn’t find anything about it in the latest Ruta docs either. >>>>>> >>>>>> Cheers >>>>>> Mario >
