uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Lally <ala...@alum.rpi.edu>
Subject Re: When to use CAS.addFsToIndexes ?
Date Fri, 11 Sep 2009 13:47:33 GMT
On Fri, Sep 11, 2009 at 6:13 AM, Jörn Kottmann <kottmann@gmail.com> wrote:
> Lets consider a tokenizer which creates token annotations, in this case its
> pretty clear
> that a call to addFsToIndexes is needed to make the token annotation
> accessible by other
> AEs.
>
> Now lets extend the token annotation with a pos feature, and this feature
> links to
> pos feature structure (and not directly to a string). A pos tagger now
> creates and
> links these pos feature structures, should the pos tagger also call
> addFsToIndexes for
> each created pos feature structure ?
>
> If its not called, I assume the only way to access the pos features
> structures is over
> the token annotations, which is fine in this scenario.
> Is there a good reason to call addFsToIndexes anyway ?
>
> After reading through our XMI serializer code I am not exactly sure what
> happens
> when the CAS is serialized and de-serialized. Are pos feature structures
> then indexed ?
>

For each CAS view, the XMI serializer writes a cas:View element that
contains a list of IDs of FeatureStructures that are indexed in that
view.  On deserialization, only those same FS's will be added to the
indexes.

I would only add something to the indexes if you expect it might
useful to access it directly from the indexes.  In your example, it
doesn't seem particularly useful to iterate over POS's of all the
Tokens without also getting the Tokens themselves, so I would
recommend not adding them to the indexes.

 -Adam

Mime
View raw message