Some other concepts to remember when thinking about these things: Data in the UIMA CAS is there to be passed between components. While inside one component, you are free to use whatever "native" data structures your language (e.g., Java) has. So, if you were designing a component, and needed to insert / remove things in a list, inside one component, you could use one of Java's List implementations, or perhaps things like HashSets, etc. When your component finished, and wanted to put data into a format for sharing with other components, it could put this data into the CAS.
List operations typically involve creating / releasing lots of "cons cells" (in Lisp terms) or in CAS terms, FSList feature structures. Environments like Java and Lisp and some others come with "garbage collection", built in. But the CAS does not (currently) have "garbage collection". So, if you use FSList operations, and do a lot of new link creation **and deletion**, the "deletion" part will not free up any space in the CAS. (Note that this is not an issue if you are using FSList operations to only "add" new elements to the list.) The current best practice seems to be to use native data structures to do things involving lots of list element updating with deletion, inside one component, where possible, and store any results you want communicated to other components in the CAS after things stabilize (if possible). (Others may chime in here on their thoughts re: best practice :-) -Marshall Thomas Francart wrote: > > Hi again UIMA gurus > > Working with FSList and FSArray in UIMA type systems looks like a lot > of fun... : > > 1. I just can't figure out a way to iterate over a FSList, or > NonEmptyFSList... how can I iterate over a feature that is defined as > an FSList ? I can't find anything describing this in the documentation > anywhere. > > 2. Similarly, I can iterate over a FSArray, but it looks tedious to > add elements into it (what should I do when the array exceeds it size > ?) any example of how to do that ? > > 3. Can anyone provide any quick explanation about the objectives > behind the design of the FSList class ? (at least, knowing WHY it is > like that would help me to live with it...) > > Btw, I have added the "improvement of FSArray and FSList" as a > suggestion in the UIMA requirements/suggestions wiki. > > Best > Thomas > > > -- > Thomas Francart > Mondeca > 3, cité Nollez 75018 Paris France > Tel: +33 (0)1 44 92 35 04 - Fax: +33 (0)1 44 92 02 59 > Blog: mondeca.wordpress.com <http://mondeca.wordpress.com> > Web: www.mondeca.com <http://www.mondeca.com> > Mail: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
